Plate Templating Reference

Liquid

Plate uses Liquid as the templating engine, supplemented with Plate-specific tags and filters. Please go to https://shopify.github.io/liquid/ to learn more about Liquid and how it works. You can also find documentation on the default Liquid tags and filters there. The Plate-specific tags and filters are documented on this site.

Liquid consists of three categories: Tags, Filters and Objects.

Tags

With Tags you can use some programming logic inside Liquid. E.g. to show content only under certain conditions, you’d use the if tag.

Input:

{% if site.name == "A beautiful site" %}
  This is indeed one beautiful site!
{% endif %}

Output:

# This is only shown if the site's title equals 'A beautiful site'
This is indeed one beautiful site!

Go to the Tags page to read the docs on Tags.

Filters

Filters manipulate content that is put in. A filter functions as a little machine where you put something in, and it returns something else. Filters are separated by a pipe (|) and can be chained.

Input:

{{ "A beautiful site" | append: " brought to you by Plate" }}

Output:

A beautiful site brought to you by Plate

Go to the Filters page to read the filters docs.

Objects

An Object represents a certain record (from the Plate database) inside Liquid. You can call attributes on an object. E.g. to get the current site’s name, you’d call the attribute name on the object site:

Input:

{{ site.name }}

Output:

A beautiful site

Some objects are globally available, and some only in certain theme files. Globally available objects are:

Go to the Objects page to read the docs on Objects.