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:

1 {{ site.name }}

Output:

1 A beautiful site

 

Available objects

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

  • Site

  • Post

  • Request

  • Breadcrumbs

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

Objects contain attributes that you can call in theme files. These attributes are mostly set by you (Content Fields), and filled with a value by the user. To call the object’s attribute, (E.g. a post’s title) you call it like a variable (wrapped in {{ and }}).

Input:

1 {{ post.title }}

Output:

1 This is a great post!

In the list below you’ll find documentation on the object’s default attributes. But after adding a Content Fields, the resulting attributes are called in the same way.

Calling attributes using dynamic names

Part of liquid functionality is that you can also call attributes by using brackets. This will allow you to call dynamic variable names on an object:

Input:

1 2 3 4 {% assign attribute_name = "name" %} {{ site["name"] }}<br> {{ site[attribute_name] }}

Output:

1 2 A beautiful site<br> A beautiful site