Replaces the Widget Editor to enable support for advanced form fields such as UploadField
Installs: 1 024
- silverstripe/recipe-core: ~4.6
- silverstripe/widgets: ~2.0
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ~3.4
- webbuilders-group/silverstripe-collapsiblewidgets: Extends the widget area editor and makes used widgets collapsible
Replaces the Widget Editor to enable support for advanced form fields such as
- SilverStripe 4.6+
- SilverStripe Widgets ~2.0
composer require undefinedoffset/silverstripe-advancedwidgeteditor
To use advanced widget editor over the default SilverStripe widgets editor you need to change your extension from WidgetPageExtension to use AdvancedWidgetPageExtension instead.
Page: extensions: - 'UndefinedOffset\AdvancedWidgetEditor\Extensions\AdvancedWidgetPageExtension'
Controlling Available Widgets per-class
To control widgets on a per-class host class (class which the Advanced Widget Editor is controlling the widget area for), you can use the config property available_widgets for example:
Page: available_widgets: - "RSSWidget" - "MyExampleWidget" SilverStripe\Blog\Model\Blog: available_widgets: - 'SilverStripe\Blog\Widgets\BlogArchiveWidget' - 'SilverStripe\Blog\Widgets\BlogCategoriesWidget' - 'SilverStripe\Blog\Widgets\BlogTagsCloudWidget' - 'SilverStripe\Blog\Widgets\BlogRecentPostsWidget'
In the case of the above example the
Page class and it's decedent classes will have the
MyExampleWidget available. Where the
SilverStripe\Blog\Model\Blog class and it's decendent classes will also have ArchiveWidget, BlogManagementWidget, etc along side the
You can also restrict widgets from decedent classes using the example above say we want to restrict the
SilverStripe\Blog\Model\Blog class to not have access to the
RSSWidget but still have
Page be allowed to use that widget, for example you can use the bellow:
SilverStripe\Blog\Model\Blog: restricted_widgets: - "RSSWidget"
Reporting an issue