Documentation

Managing Widgets

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: Site Settings - Widgets

  1. Widgets menu is located at the middle of the Site Settings menu.
  2. Button to add new reusable content widget.
  3. Button to register server widget.
  4. Button to edit widget.
  5. Button to see usages of the widget.
  6. Button to go to the history of the widget (it is possible to restore the changes!)
  7. 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. Edit Html Widget

  1. Input filed for widget title.
  2. Widget category (for reference only).
  3. Text editor to add all the Html content needed.
  4. If you are not planning to use any Html in your widget, you can choose not to render it.
  5. You can customize your widget by adding additional options.
  6. Or you can style it and add some dynamics by adding custom CSS and JavaScript.
  7. Buttons to save or cancel all the changes you made for the widget.

Register Server Widget

Server Widgets registration is an 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 by yourself. Just follow the instructions.

Go to the Site Settings Widgets menu, click on the dropdown arrow near Add New button and hit the Register option.

Edit Server Widget

  1. Input page title.
  2. Select the category you want our widget to be in.
  3. Type the server path to the widget (must be provided by the widget developers).
  4. Set the preview image URL path to identify the widget (optional).
  5. The preview image will be shown here if you provided a correct URL in step 4.
  6. Open and input all the widget options if any were provided by the widget creator. More about options how to manage them can be found [here] (https://github.com/devbridge/BetterCMS/wiki/Options).
  7. 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:

Insert widget to widget

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:

Widget-in-widget context menu

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.

Insert dynamic region into widget

Managing multilingual widgets

Multilingual Html content widgets can be created by defining options in different languages.

Managing multilingual widgets

If you have multiple languages in your site, you will see an additional dropdown list for selecting a language when adding widget options. By switching languages, you can edit option values for each of them. When a value is not defined for a specific language, the one defined in Default language will be used.

Here we created an option Title, it's default value is Insert your title here.... We have translated this option in two languages: English and Lithuanian.

English translation

Lithuanian translation

To use the translated option, insert it in widget's Html content as a smart tag.

Translated option usage

When the widget is inserted in a page, it's language is determined by the language of the page. So, if we insert our widget in an english page, it will be rendered with an english Title option.

English rendered widget

Lithuanian Title option will be rendered in a Lithuanian page.

English rendered widget

The default Title option will rendered in pages with default language or any other language we have not translated yet.

English rendered widget

To find out more about multilingual pages, read here.