@ -124,21 +124,26 @@ In this image, after choosing your widget (on the other case, it changes automat
You can edit this output manually if do any wrong coding for that (wrong value or typo) you won't see the widget, even so, your page will be viewed successfully.
## Options
To configure the widget, you should define the below code in YourModule.cs
## Options
To add content widgets, you should configure the `CmsKitContentWidgetOptions` in your module's `ConfigureServices` method:
The `CmsKitContentWidgetOptions` provides two methods for registering widgets:
* `widgetName` is used for your widget name used in code for the name of the `ViewComponent`.
- **AddWidget:** Registers a widget that will be available in the content editor. It accepts the following parameters:
- `widgetType` (required): A user-friendly name for the widget that appears in the widget selection dropdown and is used in content markup. For example, in `[Widget Type="Today"]`, `"Today"` is the `widgetType`.
- `widgetName` (required): The name of the `ViewComponent` that will be rendered. This must match the `Name` attribute of your `ViewComponent` (e.g., `[ViewComponent(Name = "CmsToday")]`).
- `parameterWidgetName` (optional): The name of the parameter widget that will be displayed in the "Add Widget" modal to collect parameter values from users. This is only required when your widget needs parameters.
* `parameterWidgetName` is used the for editor component side to see on the `Add Widget` modal.
After choosing the widget type from listbox (now just defined `Format`) and renders this widget automatically. It's required only to see UI once using parameters
- **AddWidgetIfFeatureEnabled:** Registers a widget conditionally, only if a specified [global feature](../../framework/infrastructure/global-features.md) is enabled. It accepts the same parameters as `AddWidget`, plus an additional first parameter:
- `featureType` (required): The type of the global feature that must be enabled for the widget to be available (e.g., `typeof(PagesFeature)`).