QuillObjects
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 present on page templates. A few global fields are also present on every template, not just pages.
Page properties
| Property | Type | Description |
|---|---|---|
page.id | number | The unique page ID |
page.title | string | The page title |
page.handle | string | The URL slug (e.g. about-us) |
page.content | string | The full HTML content |
page.url | string | The URL path |
page.published_at | string | When the page was published |
page.author | string | The page author, if set |
page.featured_image | image | The page's featured image |
page.template | string | The page template name |
page.sections | array | The page's body sections |
page.metafields | object | Custom data fields |
<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:
| Property | Type | Description |
|---|---|---|
page_title | string | The text for the <title> tag |
page_description | string | The meta description |
canonical_url | string | The canonical URL for this page |
content_for_header | string | Scripts and tags injected into the <head> |
In your layout
These are mainly used in the 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 handy when you want to show text from one page inside a different template, like an "About" blurb in the footer.