editable_control

Description

Editable areas contain content you want a user to be able to change. The content within the tag will be the default one.

In the back-office, the editable element will be found under the tab corresponding to the block wrapping it. It is possible to associate the element to another block.

The input field in the back-office used to edit the content is a select field.

An element can be inherited by children, each page keeping its own version of the content. However, in some cases, it may be a requirement to have the element to be editable in one place. If so, just set the "fixed" option to true.

You must give these sections a unique name because they will be inherited by children.

Syntax

{% editable_control <name>(, <options>) %}<default value>{% endeditable_control %}

Example

{% capture menu_enabled %}{% editable_control "menu", options: 'true=Yes,false=No', hint: "Tell if the menu is displayed or not", priority: 1 %}
  false
{% endeditable_control %}{% endcapture %}

{% if menu_enabled == 'true' %}
  DISPLAYED
{% endif %}

Options

Name Type Description
options String options are separated by comma and value/label by a the "equals" sign. Ex: v1=l1,v2=l2,v3=l3,..etc.
block String associate the element with a block other than the current one.
fixed Boolean make the element editable in one place. The default value is false.
hint String text displayed in the back-office just below the select field.
priority Integer used to position the file field in the back-office. Elements with the highest priority are displayed first.
© 2024 LocomotiveCMS Terms of use Privacy Policy
Back to top