The following tutorial demonstrates how to add a Site selector in your widget's designer. You use the Site selector to select different sites defined in your Sitefinity CMS application.
For more information on the scripts that you must load, see List of selectors scripts reference.
In the code above, you use the propertyService to load the properties of your widget. Next, you create a scope property to hold the Site value. You can watch for any changes in the scope to update the widget properties. For more information about getting and setting the selected item, see Use content items selectors.
In your DesignerView.<YourView>.cshtml file, place the following tag where you want to render the Site selector:
NOTE: If you do not supply a value for the sfSite attribute, the Site selector selects the default Sitefinity CMS backend site. In addition, if Sitefinity is in single site mode the Site selector is not rendered.
To access the selected site, you use the sf-site attribute. You must add the following property in your widget's controller:
The value of the sf-site attribute is the sfSite scope property, which has the following JSON structure:
Sign up for our free beginner training. Boost your credentials through advanced courses and certification. Register for Sitefinity training and certification.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important