Liquid - Tags: Theme
Last edit: Jul 14, 2023
liquid
Allows writing multiple tags within one set of delimiters. Use the echo tag to output an expression within a {% liquid %}
tag.
Input
{% liquid
case section.blocks.size
when 1
assign column_size = ''
when 2
assign column_size = 'one-half'
when 3
assign column_size = 'one-third'
else
assign column_size = 'one-quarter'
endcase %}
echo
Outputs an expression in the rendered HTML. This is identical to wrapping an expression in {{
and }}
, but works inside liquid tags and supports filters.
Input
{% liquid
assign name = 'mike'
assign second_name = 'bill'
echo name
echo 1 | plus: 1
%}
Output
mike2
Note
This topic is a compilation of knowledge found at: Shopify Themes, Liquid Documentation, Liquid Gem Documentation, and Liquid for Designers.