Skip to content

Box Pages

A Box page is a collection of Boxes. It has the same attributes as an October CMS page, like a URL, layout, title or meta information.

Code

Each page has a unique code. It is generated automatically from the title of the page on creation and will remain the same even if you change the title later. It is meant to be used as a unique identifier for the page. You can change it manually if you want to.

You can find the code on the Developer tab, when editing a Page.

Use the code to interact with the Page programmatically. See Accessing Page information in Twig below for details.

URLs

The URL for a Box page is optional. If you define a URL, the Page will automatically be available in the frontend by visiting that URL.

If the URL is left blank, the Page is only accessible if you render it manually.

Nested pages

Pages can be nested. You can use a Page to group other Pages below it. The parent page acts as a "folder" and does not have to have any content. This helps you to keep your content organized.

Accessing Page information in Twig

Each Page has a unique code. You can find it on the Developer tab, when editing a Page.

Use the code together with the | boxesPage filter to get specific Page attributes in Twig:

twig
{# By default, the boxesPage filter returns the URL to
   a Page with a given `code` #}
<a href="{{ 'imprint' | boxesPage }}">
    {# Use the `attribute` argument to fetch a specific property of the page #}
    {{ 'imprint' | boxesPage({attribute: 'title'}) }}
</a>

boxesPage when using the Multisite feature

If you are using the Multisite feature, it is recommended to always pass a code of a Page on the main site to boxesPages.

Boxes will automatically return the "translated" page data for the currently active site.

twig
{# returns "/imprint"   if the EN site is active,
        or "/impressum" if the DE page is active #}

{{ 'imprint' | boxesPage }}

Linking to a Page

There are two ways to link to a Boxes Page:

1. Use the boxesPage filter in Twig

See Accessing Page information in Twig above for details.

twig
<a href="{{ 'imprint' | boxesPage }}">
    {{ 'imprint' | boxesPage({attribute: 'title'}) }}
</a>

You can also use October's |link filter to link to a Boxes Page.

twig
{# replace `code-of-your-page`, see "Code" above. #}
<a href="{{ 'october://offline-boxes-pages@link/code-of-your-page' | link }}">
    {{ 'imprint' | boxesPage({attribute: 'title'}) }}
</a>

Note

If you are using multiple sites, you should always use he code of the Page on the main site. Boxes will automatically return the correct URL for the currently active site.