editable_text

Description

The editable_text tags are placeholders for content that you want users to be able to edit through the back-office. They replaced the now deprecated editable_short_text and editable_long_text tags.

Users can change the content of an editable_text tag by going to the pages section of the back office, selecting the page on which the tag appears, and then selecting the tab which corresponds to the name of the block wrapping the tag. Each editable_text tag is represented by a textarea labled with the editable_text's name. When no text has been entered into the back-office, the content within the tags is displayed by default.

If a block containing an editable_text tags is inherited by child pages, these child pages each store its own version of content and can be edited separately. For cases requring a single version of the content to be used on all pages and editable in only one location (such as text in the header or footer of a site), make use of the fixed option described below.

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

Syntax

{% editable_text <name>(, <options>) %}<default value>{% endeditable_text %}

Example

{% editable_text "sample_title", hint: "Description of this area." %}
Default Content
{% endeditable_text %}

Options

Name Type Description
block String associate the element with a block other than the current one. This determines what tab this tag's textarea appears under in the back-office.
fixed Boolean makes the element editable in one place. The default value is false.
format String accepted values are html and raw. If set to html, content is not escaped and will be rendered as html. If set to raw, any html content will be escaped and rendered as text. The default value is html.
hint String text displayed in the back-office just below the textarea.
line_break Boolean if true, the text is ouput inside <div> tags, which are displayed as blocks in HTML and will consequently be separate line from surrounding elements. If false, the text is output inside <span> tags, which are displayed inline (so the text will not break to a new line). The default value is true.
priority Integer used to position the textarea in the back-office. Elements with the highest priority are displayed first.
rows Integer determines the height of textarea in the back-office, measured in rows of text. The default value is 10.


Although it may be tempting to use editable_text or any other editable elements within snippets, it is highly recommended to not doing it because it makes the content rendered by the engine not reliable.


editable_short_text and editable_long_text

The editable_text tag described above was added in Locomotive CMS engine version 2.2. Prior to this version two similar tags, editable_short_text and editable_long_text were available, but are now deprecated. For those using previous versions, please consult the explanations below.

editable_short_text tags are roughly equivalent to the editable_text tags described above, except that:

  • Only the block, fixed, hint, and priority options are available
  • Content is always output in <span> tags
  • Content is never escaped. All content is rendered as HTML.
  • The size of the back-office textarea cannot be changed and is shorter than the one generated for editable_long_text

editable_long_text tags are roughly equivalent to the editable_text tags described above, except that:

  • Only the block, fixed, hint, and priority options are available
  • Content is always output in <div> tags
  • Content is never escaped. All content is rendered as HTML.
  • The size of the back-office textarea cannot be changed.
© 2024 LocomotiveCMS Terms of use Privacy Policy
Back to top