QUANTM7 Docs

Page

The page object for static content pages, plus global page-level properties.

The page object holds the content of a static page (like "About Us" or "Contact"). It is available on page templates. There are also a few global page-level properties available on every template.

Page properties

PropertyTypeDescription
page.idstringThe unique page ID
page.titlestringThe page title
page.handlestringThe URL slug (e.g. about-us)
page.contentstringThe full HTML content
page.urlstringThe URL path
page.published_atstringWhen the page was published
<article>
  <h1>{{ page.title }}</h1>
  <div class="page-content">
    {{ page.content }}
  </div>
</article>

Global page properties

These are available on every page, not just static pages:

PropertyTypeDescription
page_titlestringThe text for the <title> tag
page_descriptionstringThe meta description
canonical_urlstringThe canonical URL for this page
content_for_headerstringScripts and tags injected into the <head>

In your layout

These global properties are mainly used in the theme layout file:

<head>
  <title>{{ page_title }} – {{ store.name }}</title>
  <meta name="description" content="{{ page_description }}" />
  <link rel="canonical" href="{{ canonical_url }}" />
  {{ content_for_header }}
</head>

Accessing all pages

The global pages object gives you access to every static page in the store:

{% for p in pages %}
  <a href="{{ p.url }}">{{ p.title }}</a>
{% endfor %}

You can also look up a page by its handle:

{% assign about = pages['about-us'] %}
<div>{{ about.content }}</div>

This is useful when you want to pull content from one page into a different template, like showing a short "About" blurb in the footer.

Navigation menus are stored in linklists (also called menus). Each menu has a handle and a list of links.

PropertyTypeDescription
link.titlestringThe link text
link.urlstringThe URL the link points to
link.activebooleantrue if this link matches the current page
link.linksarrayChild links (for dropdown menus)
{% assign main_menu = linklists['main-menu'] %}
<nav>
  {% for link in main_menu.links %}
    <a href="{{ link.url }}" {% if link.active %}class="active"{% endif %}>
      {{ link.title }}
    </a>

    {% if link.links.size > 0 %}
      <ul class="dropdown">
        {% for child in link.links %}
          <li><a href="{{ child.url }}">{{ child.title }}</a></li>
        {% endfor %}
      </ul>
    {% endif %}
  {% endfor %}
</nav>

On this page