Skip to content

Latest commit

 

History

History
67 lines (51 loc) · 2.65 KB

README.en.md

File metadata and controls

67 lines (51 loc) · 2.65 KB

Page Builder for Evolution CMS

Other languages: Russian

The configuration for the blocks is taken from the config folder. To create a new block, you need to create a .php file in this folder, which should return an associative array. The structure of the array is as follows:

KeyValue
titleBlock name visible to the manager when filling in Value
fields Associative array of used fields, in which the keys are field identifiers, and the values are the arrays of options for these fields.

The possible field types and options are listed below.

templates An associative array containing the template for the "owner" key, as well as templates for each field group.

If for example the "images" group is used in the field array, then an element with the "images" key must be defined in the templates which will contain either the template string:

'images' => '<img src="[+image+]" alt="[+title+]" class="slide">'

Or an associative pattern array:

'images' => [
  'item'  => '<img src="[+image+]" alt="[+title+]" class="slide">',
  'thumb' => '<div class="thumb" style="background-image: url([+image+])"></div>',
],

In the second case, the output of these elements in the parent template can be used as "[+images.item+]" and "[+images.thumb+]".

The structure of the array for describing the field

KeyValue
captionThe name of the field that the manager sees
typeType of field, see below
themeThe editor's topic for the "richtext" field, the available values can be viewed in the Evolution CMS configuration, on the "Interface" tab
optionsAdditional options for the "richtext" field, values can be viewed here
fieldsNested fields, for type "group"

Field types

ValueDescription
textText single line field
imageText field with thumbnail and button for image selection
richtextText editor TinyMCE 4
groupField group, it is necessary to specify nested fields in the key "fields" Text editor

Configuration examples

Examples of configuration can be found here