Link widget components
This article gives an overview of how widget components interact and how you connect them to create a complete widget.
: Consider you have the following widget components:
- Widget template:
- Designer template:
- Designer controller:
SAMPLE: You can download all the widget files from folder
\WebFormWidgetsSamples\HelloWorld in Sitefinity documentation-samples on GitHub.
Link the widget
SAMPLE: For a sample code of a widget class, see
HelloWorld.cs in Sitefinity documentation-samples on GitHub.:
Link the designer
SAMPLE: For a sample code of a widget designer, see
HelloWorldDesigner.cs in Sitefinity documentation-samples on GitHub:
- Link to the designer template
HelloWorld sample, the designer class is
HelloWorldDesigner.cs and the designer's template is
HelloWorldDesigner.ascx. The designer class needs to know which template file to load. You do this by overriding the
LayoutTemplatePath property. Because the template of the custom widget is always an Embedded Resource, you must enter a full path to the designer's template.
- Register the control designer script
HelloWorld sample, the control designer class is
HelloWorldDesigner.js. You must register it in the designer by overriding the
Register the widget
When you are finished with the development of you widget, you must register it.
For more information, see Register a new widget in Sitefinity CMS toolbox.