Individual widgets can be created and deleted within the Control Panel; however, when distributing an application, being able to define widgets that cannot be deleted (similar to core factory defaults) may be a requirement.
All factory default widgets are defined through IScriptedContentFragmentFactoryDefaultProvider plugin implementations. The full name of this type is Telligent.Evolution.Extensibility.UI.Version1.IScriptedContentFragmentFactoryDefaultProvider and it exists within the Telligent.Evolution.ScriptedContentFragments assembly. In addition to the base IPlugin members, it adds the following:
Guid ScriptedContentFragmentFactoryDefaultIdentifier { get; }
This property exposes the unique identifier used for this set of factory default widgets.
Once an IScriptedContentFragmentFactoryDefaultProvider is implemented and deployed to the bin/ folder of a Telligent Evolution site, it must be enabled within the Plugin Management area of the Control Panel before its defined factory defaults will show in the widget list.
Once the plugin has been deployed, new factory default widgets can be defined within the "defaultwidgets" Centralized File System provider. By default, this is located within the web folder at web/filestorage/defaultwidgets/ and all files associated to a factory default widget set should be stored within a sub-folder named using the GUID identifier defined by the IScriptedContentFragmentFactoryDefaultProvider.ScriptedContentFragmentFactoryDefaultIdentifier implementation associated to the widget set For example, if the widget set used the GUID identifier "5a95aa7c-5da7-471a-8d9e-7c8d90bac381", the folder containing widget files associated to the widget set would be web/filestorage/defaultwidgets/5a95aa7c5da7471a8d9e7c8d90bac381/ (note that all non-alpha-numeric characters are removed in the folder name).Within this folder, new defaults can be defined using these guidelines:
Factory default widgets are defined using the XML export format for widgets. This is the same format used within the widget editor within the Control Panel when exporting widgets with one difference: embedded files will not be read. To add files associated to a widget, see the next section on defining widget files.
Any XML file within the root of widget sets folder will be parsed when loading factory defaults from the widget set.
Files should be directly added to the factory default widget set's folder instead of being embedded within the XML export file for each widget. Files should be placed in a sub-folder of the factory default widget set's folder named using the instance identifier of the widget to which the files should be associated. For example, if the factory default widget set's identifier (IScriptedContentFragmentFactoryDefaultProvider.ScriptedContentFragmentFactoryDefaultIdentifier) is "5a95aa7c-5da7-471a-8d9e-7c8d90bac381" and a widget's unique identifier is "3a65a71d-1448-4420-a59f-5b8038da9868," files associated to this widget should be placed within the web/filestorage/defaultwidgets/5a95aa7c5da7471a8d9e7c8d90bac381/3a65a71d14484420a59f5b8038da9868/.
Note that just like the widget editor in the control panel, widget files cannot be organized into sub-folders. Only files within the web/filestorage/defaultwidgets/[WIDGET_SET_PLUGIN_IDENTIFIER]/[WIDGET_INSTANCE_IDENTIFIER]/ folder will be recognized.
Related information
- Factory Default Widgets
- Creating a Factory Default Widgets Plugin