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:
Key | Value |
---|---|
title | Block 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:
Or an associative pattern array:
In the second case, the output of these elements in the parent template can be used as "[+images.item+]" and "[+images.thumb+]". |
Key | Value |
---|---|
caption | The name of the field that the manager sees |
type | Type of field, see below |
theme | The editor's topic for the "richtext" field, the available values can be viewed in the Evolution CMS configuration, on the "Interface" tab |
options | Additional options for the "richtext" field, values can be viewed here |
fields | Nested fields, for type "group" |
Value | Description |
---|---|
text | Text single line field |
image | Text field with thumbnail and button for image selection |
richtext | Text editor TinyMCE 4 |
group | Field group, it is necessary to specify nested fields in the key "fields" Text editor |
Examples of configuration can be found here