Standard lexicon

Tags

What is a tag? A tag is a "block" of Liquid code that can be used in any way, from looping, to control flow, even adding and removing roles works with tags.

{% assign var = "This is an assign block. It's used to create variables" %}

Filters

Filters are somewhat simpler. They transform one value into another and can be chained. For example, the following code transforms a string (text) into a number and then performs some math on it, then prints it.

{% assign number = "5" | plus: 2 | multiply: 6 %}
{{ number }}

The result is:

42

Printing tag

Finally, we get to the most important part of our code: displaying it. Tags aren't displayed, or if they do, it's not meant for the user to see. That's why we'll talk about error handling in one of the next chapters. You can print variables created through capture and assign with a {{ mustache }} block, similar to the one above.