Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

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

 

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:

{{ post.title }}

Output:

This is a great post!

In the list below you’ll find documentation on the object’s default attributes. But after adding a content field, 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:

{% assign attribute_name = "name" %}

{{ site["name"] }}<br>
{{ site[attribute_name] }} 

Output:

A beautiful site<br>
A beautiful site 
  • No labels