Skip to main content

Categories

categories provides collections of Category objects, and category exposes a single category.

note

Theme v3+ pages are cached without query parameters. If you need to apply URL-driven filters, read the parameters in JavaScript and call the Public API v2 search endpoints: /reference/public-api/search.

Categories collection

Allows to iterate through all Categories in the website. They are sorted by position.

Example

{% if categories.all.size > 0 %}
{% for category in categories.all %}
...

Available attributes:

NameTypeDescription
allCollectioncollection of all categories
promotedCollectioncollection of all promoted categories

Category

Gives you access to attributes of Category.

Example

<h2>{{ category.title }}</h2>

Available attributes

NameTypeDescription
contentStringcategory's content
handleStringcategory's handle. This is the category's title in lowercase with any spaces and special characters replaced by hyphens (-).
idIntegercategory's id
page_titleStringused inside title
page_descriptionStringused inside meta description
photosCollectioncollection of all published photos
promotedBooleancheck if a category is promoted or not
titleStringcategory's title
urlStringcategory's URL

Category Locale

Available attributes:

  • url

Category Locales

Available attributes:

  • available
  • default