Skip to content

Site Builder

Theme Data

Templates, the layout and snippets can read your ArrayQ data through three objects: site, page and service. Data is loaded only when a page uses it, so a page that never mentions site.items never loads them.

site.provider

Your business profile, from your dashboard.

FieldTypeExample
businessNameTextClearway Junk Co.
slugTextclearway-junk-co
aboutTextYour about text, with line breaks
logoImage URL
businessEmailText
businessPhoneText
linksList of URLsSocial and other links
galleryList of image URLs
liquid
<a href="tel:{{ site.provider.businessPhone }}">{{ site.provider.businessPhone }}</a>
<p>{{ site.provider.about | newline_to_br }}</p>

site.services

Your Active services, oldest first. Each service has:

FieldTypeNotes
_idTextUse it for the checkout link: /checkout/{{ service._id }}
titleText
slugTextUse it for the service page: /services/{{ service.slug }}
descriptionHTMLWritten in the dashboard editor
coverImage URLCan be empty
categoryListEach has name
discountObjectSet only while an automatic discount is active. Has displayName, type, value, description, coverImage, startDate and endDate
priceInputsListThe questions asked on checkout
isSpecificItemSupportedYes or noWhether customers pick items on checkout
liquid
{% for service in site.services %}
  <article>
    {% if service.cover %}<img src="{{ service.cover }}" alt="{{ service.title | escape }}">{% endif %}
    <h3><a href="/services/{{ service.slug }}">{{ service.title }}</a></h3>
    <p>{{ service.description | strip_html | truncate: 140 }}</p>
    <a href="/checkout/{{ service._id }}">Book now</a>
  </article>
{% else %}
  <p>No services yet.</p>
{% endfor %}

service

On templates/service.liquid, service is the service whose slug is in the URL, with the same fields as above. On every other page it is empty.

liquid
<h1>{{ service.title }}</h1>
{% if service.discount %}<p>{{ service.discount.displayName }}</p>{% endif %}
<div>{{ service.description }}</div>
<a href="/checkout/{{ service._id }}">Book {{ service.title }}</a>

site.categories

All your categories. Each has name.

site.items

Items customers can book, most popular first. Each item has:

FieldType
nameText
slugText
imageImage URL
priceNumber
categoriesList, each with name
subItemsList, each with name, image, price and status
liquid
{% assign items = site.items | slice: 0, 8 %}
{% for item in items %}
  <li>{{ item.name }} {% if item.price %}${{ item.price }}{% endif %}</li>
{% endfor %}

page

FieldExample
page.pathThe URL being shown, such as /about or /services/junk-removal
page.slugThe slug from the URL on the service page, otherwise empty

In snippets

site, page and service work inside every snippet. Anything else, such as the variable of a for loop, has to be passed:

liquid
{% for service in site.services %}
  {% render 'service-card', service: service %}
{% endfor %}

Search engine tags

Build titles and descriptions from your data, usually in a seo snippet that the layout renders in head:

liquid
{% if service %}
  <title>{{ service.title }} | {{ site.provider.businessName }}</title>
  <meta name="description" content="{{ service.description | strip_html | truncate: 155 | escape }}">
  <link rel="canonical" href="/services/{{ service.slug }}">
{% else %}
  <title>{{ site.provider.businessName }}</title>
  <meta name="description" content="{{ site.provider.about | strip_html | truncate: 155 | escape }}">
{% endif %}

Escaping

Output is not escaped automatically. Text typed in the dashboard can contain quotes or <, so add | escape whenever you put a value inside an HTML attribute:

liquid
<img src="{{ service.cover }}" alt="{{ service.title | escape }}">

service.description is HTML on purpose. Output it as it is, or use | strip_html for plain text.

Tags and filters

Themes support standard Liquid, the same language Shopify themes use:

  • Tags: if, unless, case, for, assign, capture, render, comment, raw and more.
  • Filters: escape, strip_html, truncate, newline_to_br, date, upcase, downcase, slice, size, where, sort, map, default and more.

Using a filter that does not exist stops the page from rendering, so check the spelling.

Limits and caching

  • A page must finish rendering within 2 seconds.
  • A page that fails to render returns an error instead of a half-finished page. Fix the template and publish again.
  • Rendered pages are cached for up to 1 minute. A change to a service in your dashboard shows on your site within a minute, without publishing again. A new publish shows immediately.