Templates
Syntax
There are two types of markup in Liquid: Output and Tag.
-
Output markup
(which may resolve to text) is surrounded by {{ matched pairs of curly brackets }}
-
Tag markup
(which cannot resolve to text) is surrounded by {% matched pairs of curly brackets and percent signs %}
Output
An output statement is a set of double curly braces containing an expression; when the template is rendered, it gets replaced with the value of that expression.
Here is a simple example of output:
{{model.Name}}
Advanced output: Filters
Output markup can take filters, which modify the result of the output statement. You can invoke filters by following the output statement's main expression with:
-
A pipe character ( | )
-
The name of the filter
-
Optionally, a colon ( : ) and a comma-separated list of additional parameters to the filter. Each additional parameter must be a valid expression, and each filter pre-defines the parameters it accepts and the order in which they must be passed.
Filters can also be chained together by adding additional filter statements (starting with another pipe character). The output of the previous filter will be the input for the next one.
{{ model.Name | Downcase }}
{{ model.Name | RemoveLast:'Id' | Downcase }}