In Better CMS there are two types of widgets:
- Content widgets (simple html content that can be used on multiple pages);
- Server widgets;
Content widgets can be created via Better CMS control panel. They are simple to create and function in a very similar way to regular content.
Server widgets are used for the website functionality that needs server side processing.
All the widgets of the website can be found at Site Settings:
- Widgets menu is located at the middle of the Site Settings menu.
- Button to add new reusable content widget.
- Button to register server widget.
- Button to edit widget.
- Button to go to the history of the widget (it is possible to restore the changes!)
- Button to remove widget.
Create/Edit Html Content Widget
Html content widget can be treated as regular content only with feature to reuse it in multiple places on different pages. Because of that it is editable in a very similar way to the regular content editing.
- Input filed for widget title.
- Widget category (for reference only).
- Place to add all the html content needed.
- Content can has custom CSS
- Buttons to save or cancel all the changes you made for the widget.
Register Server Widget
Server Widgets registration is advanced option and intended to be used by the website administrators. But in case if you are provided with all the required information to register server side widget - its very easy to do it your self. Just follow the instructions.
Go to the Site Settings Widgets menu and hit the button Register.
- Input page title.
- Select the category you want our widget to be in.
- Type the server path to the widget (must be provided by the widget developers).
- Preview image URL path to identify the widget (optional).
- Here will be visible the preview image if you provided a correct URL in the step 4.
- Open and input all the widget options if any were provided by the widget creator. More about options how to manage options can be found [here] (https://github.com/devbridge/BetterCMS/wiki/Options).
- Save the widget.
Adding widget to another widget or to HTML content
When editing HTML widget / HTML content, child widget can be added directly to HTML. This can be done by pressing
Insert widget button and selecting the widget from the widgets list:
When widget is already inserted to the content, user can edit it's title. Title will not be visible when rendering page, it's visible only when editing HTML. By pressing the right mouse key on the widget, context menu can be opened. Context menu contains menu items for removing inner widget, editing inner widget or configuring widget options:
Inserting dynamic widget region
It is possible to add a dynamic region to a widget by clicking on 'Region' button. Inserted region will function in a very similar way as a regular content region.