Skip to content

Replaces the Widget Editor to enable support for advanced form fields such as UploadField

License

Notifications You must be signed in to change notification settings

helpfulrobot/undefinedoffset-silverstripe-advancedwidgeteditor

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advanced Widget Editor

Build Status

Replaces the Widget Editor to enable support for advanced form fields such as UploadField

Requirements

Installation

If you prefer you may also install using composer:

composer require undefinedoffset/silverstripe-advancedwidgeteditor

Usage

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:
    - '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"

BlogTree:
    available_widgets:
        - "ArchiveWidget"
        - "BlogManagementWidget"
        - "TagCloudWidget"
        - "SubscribeRSSWidget"

In the case of the above example the Page class and it's decedent classes will have the RSSWidget and MyExampleWidget available. Where the BlogTree class and it's decendent classes will also have ArchiveWidget, BlogManagementWidget, etc along side the RSSWidget and MyExampleWidget.

You can also restrict widgets from decedent classes using the example above say we want to restrict BlogHolder (a decendent of BlogTree) to not have access to the blog management widget but still have BlogTree be allowed to use that widget, for example you can use the bellow:

BlogHolder:
    restricted_widgets:
        - "BlogManagementWidget"

Reporting an issue

When you're reporting an issue please ensure you specify what version of SilverStripe you are using i.e. 3.1.3, 3.2beta, master etc. Also be sure to include any JavaScript or PHP errors you receive, for PHP errors please ensure you include the full stack trace. Also please include how you produced the issue. You may also be asked to provide some of the classes to aid in re-producing the issue. Stick with the issue, remember that you seen the issue not the maintainer of the module so it may take allot of questions to arrive at a fix or answer.

About

Replaces the Widget Editor to enable support for advanced form fields such as UploadField

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 83.3%
  • JavaScript 9.0%
  • Scheme 7.3%
  • CSS 0.4%