At times, it may be useful to have a widget placed on multiple pages share a single configuration. For example, the Group Application Navigation widget when shown on multiple pages within a group should always show the same set of navigation tabs. Widget developers can enable this behavior by defining an explicit scope for one or more widget configuration properties.
Defining a Property's Scope
A property's scope is defined by the scope attribute. Normally, a property's value is associated to a single instance of the widget, however, when scope is defined, the value will apply to all instances of the widget within the defined scope.
For example, in the following sample, the fragmentHeader property uses the default scoping (widget instance) and the navigation property defines an explicit scope of group.
<propertyGroup id="options" resourceName="Options">
<property id="fragmentHeader" resourceName="CF_Title" dataType="string" defaultValue="${resource:Groups_GroupApplicationNavigation_Name}" controlType="Telligent.Evolution.Controls.ContentFragmentTokenStringControl, Telligent.Evolution.Controls" />
<property id="navigation" dataType="custom" controlType="Telligent.Evolution.Controls.CustomNavigationCustomControl, Telligent.Evolution.Controls" maximumDepth="1" resourceName="Groups_GroupApplicationNavigation_Navigation" descriptionResourceName="Groups_GroupApplicationNavigation_Navigation_Description" navigationType="group" scope="group" />
</propertyGroup>
Supported Scopes
The default scope is the instance of the widget. This scope is used if the scope attribute is not defined. When scope is explicitly defined, the following values are supported:
- site shares the value of this property with all instances of this widget throughout the site.
- group shares the value of this property with all instances of this widget within the context of the current group.
- blog shares the value of this property with all instances of this widget within the context of the current blog.
When the user does not have the proper permission to edit themes within the property's defined scope, the property will not be shown within the widget's configuration form.