QUANTM7 Docs
QuillGuides

Context by Page

Which template objects are available on each page type across the storefront.

The data in your templates changes based on which page is being viewed. Every page gets the global objects. Some pages add extra objects for their specific content.

Global objects (all pages)

These objects are available on every page:

ObjectTypeDescription
storeobjectStore name, currency, logo, contact details, address
requestobjectCurrent path, host domain, visitor country, locale
page_titlestringTitle of the current page
canonical_urlstringCanonical URL for SEO
collectionsarrayAll store collections (id, title, handle, url)
themeobjectTheme-level settings

Page-specific objects

Some pages add extra objects. These are only available on that page type:

Page TypeExtra ObjectTypeDescription
Product pageproductobjectFull product data (title, price, images, variants, tags)
Collection pagecollectionobjectCollection data (title, description, products, sorting)
Info pagepageobjectPage data (title, content, handle)
Cart pagecartobjectCart items, quantities, totals
Blog postarticleobjectPost title, content, author, date, tags
Customer accountcustomerobjectName, email, addresses, order history

Quick reference matrix

ObjectHomepageProductCollectionInfo PageCartBlogAccount
storeYesYesYesYesYesYesYes
requestYesYesYesYesYesYesYes
page_titleYesYesYesYesYesYesYes
canonical_urlYesYesYesYesYesYesYes
collectionsYesYesYesYesYesYesYes
themeYesYesYesYesYesYesYes
productNoYesNoNoNoNoNo
collectionNoNoYesNoNoNoNo
pageNoNoNoYesNoNoNo
cartNoNoNoNoYesNoNo
articleNoNoNoNoNoYesNo
customerNoNoNoNoNoNoYes

Custom HTML sections

Custom HTML sections on the homepage get the global objects only. The product, collection, cart, and customer objects are not available. The homepage has no single product or collection in scope.

To show product data, use the collections array. Loop through it and link to each collection:

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

For product-level templates, use the full theme template system. The product object is available on product pages.

Store object details

The store object is available everywhere and contains:

{{ store.name }}              <!-- Store display name -->
{{ store.description }}       <!-- Store description -->
{{ store.currency }}           <!-- ISO code, e.g. GBP -->
{{ store.currency_symbol }}    <!-- Symbol, e.g. £ -->
{{ store.url }}                <!-- Full store URL -->
{{ store.email }}              <!-- Contact email -->
{{ store.phone }}              <!-- Phone number -->
{{ store.logo }}               <!-- Logo image URL -->

{{ store.address.address1 }}   <!-- Street address -->
{{ store.address.city }}       <!-- City -->
{{ store.address.province }}   <!-- Province or state -->
{{ store.address.zip }}        <!-- Postal code -->
{{ store.address.country }}    <!-- Country -->

Request object details

The request object tells you about the current visitor:

{{ request.path }}      <!-- Current page path, e.g. / or /products/ring -->
{{ request.host }}      <!-- Host domain, e.g. mystore.com -->
{{ request.country }}   <!-- Visitor country code, e.g. GB, US, DE -->
{{ request.locale }}    <!-- Locale, e.g. en -->

Use request.country for geo-targeted content:

{% if request.country == 'US' %}
  <p>Shipping from our US warehouse.</p>
{% endif %}

Checking for nil

Page-specific objects are nil on the wrong page type. Guard your templates with an if check:

{% if product %}
  <h1>{{ product.title }}</h1>
{% endif %}

This prevents errors when the object does not exist. On the homepage, product is nil. The block is skipped.

On this page