"components": [
{
"_group": "Headers",
"path": "components\/header1",
"_isSecondary": true
},
...
]
Avoid using attributes like ''%%`_once`%%''.
==== A component file structure ====
* template.html
* style.less
* thumb.png
A catalog may contain some images, it’s possible to refer to them the ways described below.
From parameters:
From a template:
==== Component settings (attributes) ====
Component attributes are used in a parent element of a template.
* ''%%group%%'' - group name
* ''%%plugins%%'' - a comma separated plugins
* ''%%always-bottom%%'' - a component is placed always at the bottom
* ''%%always-top%%'' - a component is placed always on the top
* ''%%global%%'' - a global component
* ''%%not-draggable%%'' - a non draggable component
* ''%%position-absolute%%'' - a component has an absolute position
Example for a menu component:
**ALERT:** The `group` attribute doesn't influence anything at this time and will be used later in the theme exporting.
===== Expressions =====
The expressions work in interpolation of values, directives and `conditions` within parameters (check the 'Interpolation in attributes' section). The expressions are the same as in **ECMAScript** (**JavaScript**), but they have some extra features:
* - The context is only local: there are no variables except for the ones declared in the parameters.
* - A tolerance to non-declared variables: the script does not fail if there is no variable or value.
* - There is a filter support (not maintained?).
* - Assigning values is not allowed.
* - Square brackets are not allowed - ''%%item['name']%%'' or even ''%%item[0]%%'' (it can work in **RivetsJS**).
* - Using of loops, conditionals and exceptions is not allowed.
* - Declaring functions isn't allowed.
* - Using of RegExp with literal notation isn't allowed.
* - Creating objects using the ''%%new%%'' operator isn't allowed.
* - Using of bitwise-operators, the ''%%,%%'' operator or ''%%void%%'' isn't allowed.
===== Parameters =====
All tags that cannot be interpreted as parameters are ignored.
==== A section title ====
Section
==== A break line ====
==== Text fields ====
==== Checkboxes/Radio buttons ====
==== A drop-down options list ====
It supports the ''%%inline%%'' attribute:
==== Color ====
==== Range ====
It supports the ''%%inline%%'' attribute:
==== Font ====
==== Image ====
==== Video ====
==== Background ====
The ''%%parallax%%'' attribute for the''%%fieldset%%'' tag shows the on/off parallax switch. If the same attribute is set for an image, it means that parallax is enabled. If it is absent, parallax is disabled.
This parameter supports only three background types ''%%image%%'', ''%%color%%'' and ''%%video%%''. The current choice is denoted by the ''%%selected%%'' parameter for a corresponding tag. The ''%%title%%'' attribute assigns a title for the switch. In the rest, the nested parameters behave like the autonomous parameters, but they don't require the''%%name%%'' attribute.
The value of the bg variable for the previous example looks this way:
{
"type": "color",
"value": "#073B4C",
"parallax": false,
"image": {
"value": "background5.jpg",
"parallax": true
},
"color": {
"value": "#073B4C"
},
"video": {
"value": {
"url": "http://www.youtube.com/watch?v=uNCr7NdOJgw"
}
}
}
The selected type of background is stored in the ''%%type%%'' key, and the value is in ''%%value%%''. If the selected type is an image, and the parallax switch is shown in the interface, then the ''%%parallax%%'' key shows whether parralax is enabled or disabled. In addition, regardless of the current selection other type settings can be get by a needed key.
Some variables are used in CSS too, but only partically.
@bg-value: "background5.jpg";
@bg-type: "image";
@bg-color-value: #073B4C;
@bg-parallax: true;
It's possible to access only the current selection through variables. The exception is ''%%@bg-color-value%%''. It can be useful in the cases when the background is an image, but it is loading slowly or can't be loaded at all. The background color should be set in the contrast with the text.
As you can see, to get the access to the values, you need to use the hyphen instead of the dot - ''%%bg.color.value%%'' in templates and ''%%@bg-color-value%%'' in CSS.
==== Map ====
It's used along with the **mbr-map** directive.
==== A hidden parameter ====
==== Conditionals ====
The ''%%condition%%'' attribute for parameters allows to control visibility depending on a condition.
===== Templates =====
==== The mbr-text directive ====
A simple text without an extended text editor.
Address...
This directive is set automatically for the following tags: **H1**, **H2**, **H3**, **H4**, **H5**, **P**.
==== The mbr-article directive ====
An article text with an extended text editor.
Lorem ipsum dolor sit amet.
...
==== The mbr-buttons directive ====
The element is interpreted as a buttons group.
==== The mbr-menu directive ====
An element is interpreted as a menu.
==== The
or
**ALERT:** Don't add directives like ''%%mbr-if%%'' to a parent link, because they can be removed with the help of an image editor. Use a container if it's needed.
==== The mbr-icon directive ====
It specifies an icon.
or
**ALERT:** You shouldn't add the ''%%mbr-icon%%'' attribute to a link.
**ALERT:** Don't add directives like ''%%mbr-if%%'' to a parent link, because they can be removed with the help of an icon editor. Use a container instead.
==== The mbr-video directive ====
An element is interpreted as a video:
==== The mbr-map directive ====
A parameter name is used as an attribute value. Only one parameter type is supported: **map**.
A map has several states:
**Loading**
**Loading error (if a location is not found)**
Not found
**Map representation**
Styles are needed during the change of address to make clear what is going on. There's a simple example:
.google-map {
height: 25rem;
position: relative;
iframe {
height: 100%;
width: 100%;
}
[data-state-details] {
color: #6b6763;
font-family: Montserrat;
height: 1.5em;
margin-top: -0.75em;
padding-left: 1.25rem;
padding-right: 1.25rem;
position: absolute;
text-align: center;
top: 50%;
width: 100%;
}
&[data-state] {
background: #e9e5dc;
}
&[data-state="loading"] {
[data-state-details] {
display: none;
}
&::after {
// loader
}
}
}
==== The mbr-form directive ====
An element is interpreted as a **form**:
It can have a nested structure. An element with a **data-form-alert** attribute is intended to show messages with the result of a form sending. To make a message initially hidden, use the **hidden** attribute.
Thanks for filling out the form!
The **name** attribute of the form is responsible for a title of a submited form.
The **action** attribute may contain an e-mail or a handler script URL.
Elements **input** placed inside a form should contain a unique **name** attribute.
The **data-form-field** value is a name of a field in a form editor window.
It's possible to add **