Themes
Objects
Reference for every object a StoreOS Fluid theme can read, and the fields on each.
Objects hold the store's data. Which ones a template can read depends on the page: see Contexts. The filters and tags that print them are on Filters and tags.
Fields can be added to these objects over time, but existing ones are never renamed or removed.
Objects on every page
| Object | Fields |
|---|---|
shop | id, uid, name, description, url, logo (an image, or empty), currency |
collections | Every collection in the store, without products. Use it for menus |
settings | The theme settings: settings.colors, settings.fonts |
request | See request |
Inside a widget, widget is also available. See The widget object.
Objects on one page
| Context | Object |
|---|---|
| Home | products: the latest products |
| Product | product, and products (related products) |
| Collection | collection |
| Page | page |
| Blog | blog |
| Blog post | article |
| Search | search |
request
| Field | Contents |
|---|---|
path | The URL path, such as /collections/shoes |
host | The store's host name |
page | The page query parameter as a number. 1 when it is missing |
sort | The sort query parameter. newest when it is missing |
q | The q query parameter. Empty when it is missing |
product
| Field | Contents |
|---|---|
id, title, handle, url | |
description | HTML, printed as-is |
short_description | HTML, printed as-is |
price, compare_at_price | Numbers: print with money. compare_at_price is empty when there's none |
available | false when sold out |
featured_image | The first image, or empty |
images | Every image |
collections | title, handle and url of each collection it's in |
options | Each option's name and values, e.g. Size: S, M, L |
variants | See variant |
has_only_default_variant | true when there are no options to choose |
technical_specs | Each spec's key, value, unit and notes (HTML) |
information_sections | Each section's title and content (HTML) |
variant
| Field | Contents |
|---|---|
id | Variant ID |
title | Its option values joined with /, e.g. M / Black |
options | Its option values as a list |
sku | |
price, compare_at_price | |
available | false when out of stock |
{% unless product.has_only_default_variant %}
<select name="variant">
{% for variant in product.variants %}
<option value="{{ variant.id }}" {% unless variant.available %}disabled{% endunless %}>
{{ variant.title }} · {{ variant.price | money }}
</option>
{% endfor %}
</select>
{% endunless %}collection
| Field | Contents |
|---|---|
id, title, handle, url | /collections/all has every product |
description | |
image | An image, or empty |
products | The products on this page of the collection |
products_count | How many products there are in all, across every page |
current_page, page_size, pages | The page being viewed, products per page, and the number of pages |
previous_page, next_page | The neighbouring page numbers, or empty on the first and last page |
See Collection for sorting and paging links.
page
id, title, handle, url, content (HTML), image.
blog
title, url, articles (a list of articles), articles_count.
article
id, title, handle, url, content (HTML), image, author, tags, published_at.
<time>{{ article.published_at | date: "%B %-d, %Y" }}</time>search
| Field | Contents |
|---|---|
terms | What the visitor searched for |
performed | true once a search was made |
results | Matching products |
results_count |
Image
Images in objects are { src, alt }. Print one with image_url:
<img src="{{ product.featured_image | image_url }}" alt="{{ product.featured_image.alt }}" loading="lazy">