Thunder: Create widget designers
From the context menu of SitefinityWebApp, click Add » New Item...
In the left pane of the Add New Window, select Sitefinity.
In the central pane, you can choose whether you want to create a new widget with a designer or create a designer for an existing widget.
Create a new widget with designer
To create a new widget with a designer, perform the following:
- In the left pane of the Add New Window, click Sitefinity CMS Widget with Designer.
The system creates a sample Overview: Built-in widgets with a Overview: Widget templates and generates a For developers: Create a simple widget designer for it. The system also Register a new widget in Sitefinity CMS toolbox in the Sitefinity CMS project, if such is available in the solution. It creates a Register a new widget in Sitefinity CMS toolboxin the widget toolbox, named Custom. If you create the widget in a class library in your Sitefinity CMS solution, the system adds a reference to the Telerik.Sitefinity.dll. The Sitefinity CMS project will reference your class library, as well. - Build and run the Sitefinity CMS project and open a page for editing.
In the toolbox, under Custom section, your newly created widget appears.
The widget contains the relative path to its widget template. If you make any changes that affect the relative path, you must reflect them in the widget too. - Drag and drop the newly created widget and use its designer.
Create a designer for an existing widget
If you already have a widget and want to create a designer for it, perform the following:
- Click Designer for Existing Widget.
A wizard appears. When you click Next, the wizard finds all the widgets in the current project.
This can take up to 30 seconds, it also freezes Visual Studio while working.
NOTE: You must build the project that contains your widget, in order for Sitefinity CMS Thunder to discover it.
- Select for which widget you want to create a designer and click Next.
- Select which properties to include in the designer of the widget (the simple view of the designer).
You can choose basic types like integer, double, string, decimal, bool, DateTime and enumerations.
- To edit a selected property, double-click it or click the Edit button.
- After selecting the properties, you can use drag-and-drop to reorder them in the way you would like them to appear in the designer.
- Click Next.
- After completing all steps in the wizard, if your widget is not registered in the page editor toolbox, you can use Sitefinity CMS Thunder to Thunder: Register a widget it.
The wizard creates three files – the designer control implementing the ControlDesignerBase class, the template, and the designer javascript component.
Creating designers for existing MVC widgets
Sitefinity CMS Thunder can find a MVC widget and create a designer for it. The designers created are Web Forms based.
IMPORTANT: The javascript component is using your designer control with its full name (<namespace>.<class>). You must change it, if you rename or move your designer component class.
When a designer or a widget is created in a web project, all the resources, such as javascript files and the .ascx templates, will be included with their application relative paths.
If the operations are done in a class library, the resources files will be included as embedded resources and the javascript files will be registered in the assembly. For the .ascx templates, the system creates a registration in the virtual path settings that is required to work with embedded .ascx templates.
Your designer control contains the relative paths to the designer template and the javascript component. If you move or rename them, you must reflect the changes in the designer control.
NOTE: If you have selected a Form widget, the system automatically adds a Developer Name (implements IFormFieldControl).