Thunder: Create Field control with selector for dynamic items
If you are using Sitefinity CMS 5.1 or above, you can create a Field control with selector for dynamic items.
Creating field controls with selector for dynamic items
To create a field control with selector for dynamic items, perform the following:
- Click your project or one of its folders and open its context menu.
- Select Add » New Item…
- In the left pane select Sitefinity CMS and in the central pane select Sitefinity CMS Dynamic Items Field Control Selector.
- Enter a name it and click Add.
- Build your project.
Adding the field control with selector to a dynamic module
You can add this field control with selector to an already existing dynamic module or you can create a new module which uses it.
When you create a content type for the module, in Step 4 of procedure Create a dynamic content type, you must add the fields for the content type. While performing procedure Create custom fields, you can add a field control with selector to a dynamic module in the following way:
- In Step 4, select Array of GUIDs.
- In Step 6, deselect This is a hidden field checkbox.
- In Step 7, select Custom…
- In Type or Virtual path of the custom widget, enter the type of the created field control with selector for dynamic items.
NOTE: To check the type of your field control, open the project in Visual Studio and open <your field control with selector for dynamic items>.cs file. You see a commented summary, where the type of your field control appears.
For example:
-
/// <
summary
>
/// A simple field control used to select a dynamic items.
/// Use the path to this class when you add the field control in Sitefinity CMS Module Builder
/// SitefinityWebApp.Sitefinity.MyNewDynamicItemsFieldControlSelector
/// </
summary
>
In this example SitefinityWebApp.Sitefinity.MyNewDynamicItemsFieldControlSelector is the type of your field control with selector for dynamic items.
You can then navigate to Content » <Your module> and create your item. You will see that a new field with selector is added.