Skip to Content
StoreOSv0.27.1
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

ObjectFields
shopid, uid, name, description, url, logo (an image, or empty), currency
collectionsEvery collection in the store, without products. Use it for menus
settingsThe theme settings: settings.colors, settings.fonts
requestSee request

Inside a widget, widget is also available. See The widget object.

Objects on one page

ContextObject
Homeproducts: the latest products
Productproduct, and products (related products)
Collectioncollection
Pagepage
Blogblog
Blog postarticle
Searchsearch

request

FieldContents
pathThe URL path, such as /collections/shoes
hostThe store's host name
pageThe page query parameter as a number. 1 when it is missing
sortThe sort query parameter. newest when it is missing
qThe q query parameter. Empty when it is missing

product

FieldContents
id, title, handle, url
descriptionHTML, printed as-is
short_descriptionHTML, printed as-is
price, compare_at_priceNumbers: print with money. compare_at_price is empty when there's none
availablefalse when sold out
featured_imageThe first image, or empty
imagesEvery image
collectionstitle, handle and url of each collection it's in
optionsEach option's name and values, e.g. Size: S, M, L
variantsSee variant
has_only_default_varianttrue when there are no options to choose
technical_specsEach spec's key, value, unit and notes (HTML)
information_sectionsEach section's title and content (HTML)

variant

FieldContents
idVariant ID
titleIts option values joined with /, e.g. M / Black
optionsIts option values as a list
sku
price, compare_at_price
availablefalse 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

FieldContents
id, title, handle, url/collections/all has every product
description
imageAn image, or empty
productsThe products on this page of the collection
products_countHow many products there are in all, across every page
current_page, page_size, pagesThe page being viewed, products per page, and the number of pages
previous_page, next_pageThe 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>
FieldContents
termsWhat the visitor searched for
performedtrue once a search was made
resultsMatching 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">

On this page