Skip to content
On this page

Box Partials

Box partials are standard October CMS partials. Once they have a Box config defined, they are available for use in the Boxes editor.

Accessing data

Every Box partial has access to a box variable. On that variable, you can access all data that was entered in the Boxes editor.

twig
<h1>{{ box.title }}</h1>

Accessing the render context

A Box is often part of a Page. Using the context variable, you can get information on where and how the Box is rendered on that page.

Loop

The context.loop variable gives you access to Twig's original loop variable.

twig
{% if context.loop.first %}
    <h1>I am the first box on this page</p>
{% endif %}

Partial

The context.partial variable gives you access to the Box partial and the Box config.

twig
Rendering {{ context.partial.path }}:
This partial is called {{ context.partial.config.name }}.