{% content %}

October CMS Documentation Docs

{% content %}

The {% content %} tag will display a CMS content block on the page. To display content block called contacts.htm you pass the file name after the content tag quoted as a string.

___TWIG0___

A content block inside a subdirectory can be rendered in the same way.

___TWIG0___

Note: The Themes documentation has more details on subdirectory usage.

Content blocks can be rendered as plain text:

___TWIG0___

You can also use Markdown syntax:

___TWIG0___

Content blocks can also be used in combination with layout placeholders:

___TWIG0___
    ___TWIG1___
___TWIG2___

# Variables

You can pass variables to content blocks by specifying them after the file name:

___TWIG0___

You can also assign new variables for use in the content:

___TWIG0___

Inside the content, variables can be accessed using a basic syntax using singular curly brackets:

<p>Country: {country}, city: {city}.</p>

You can also pass a collection of variables as a simple array:

___TWIG0___

The collection of variables is accessed by using an opening and closing set of brackets:

<ul>
    {likes}
        <li>{name}</li>
    {/likes}
</ul>

Note: Twig syntax is not supported in Content blocks, consider using a CMS partial instead.

On This Page