IMPORTANT: This version of Sitefinity CMS is out of support and the respective product documentation is no longer maintained and can be outdated. Use the version selector to view a supported product version.
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.
DesignerView.YourView.json
JSON
DesignerView.<YourView>.json
scripts
For more information on the scripts that you must load, see List of selectors scripts reference.
designerview-<yourview>.js
.js
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.
propertyService
Site
In your DesignerView.<YourView>.cshtml file, place the following tag where you want to render the Site selector:
DesignerView.<YourView>.cshtml
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.
sfSite
To access the selected site, you use the sf-site attribute. You must add the following property in your widget's controller:
sf-site
The value of the sf-site attribute is the sfSite scope property, which has the following JSON structure:
Back To Top
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important