Can you create child-layouts in October CMS?

- 1 answer

Ad

I want to have a main-layout and then several child-layouts that have some specific styling. Is this possible in October CMS? I cannot find anything on their documentation page.

Ad

Answer

Ad

maybe try using partial, where you define your child-layout code. Here is example for sidebar

<div class="container">
      <div class="row">
        <div class="col-md-9">
          {% page %}
        </div>
        <div class="col-md-3 sidebar">
          <!--right sidebar content-->

            {% partial 'sidebar' %}

        </div>
      </div>
</div>

you can even use some ifs

    {% if this.page.id == 'home'  %}
        {% partial 'home-slider' %}
    {% endif %}
Ad
source: stackoverflow.com
Ad