Skip to main content

liquid

Allows you to have a block of Liquid without delimeters on each tag.

Because the tags don't have delimeters, each tag needs to be on its own line.


Tip

Use the echo tag to output an expression inside liquid tags.


Syntax

{% liquid
expression
%}
expression

The expression to be rendered inside the liquid tag.

{% liquid
# Show a message that's customized to the product type

assign product_type = product.type | downcase
assign message = ''

case product_type
when 'health'
assign message = 'This is a health potion!'
when 'love'
assign message = 'This is a love potion!'
else
assign message = 'This is a potion!'
endcase

echo message
%}

Output

This is a health potion!
Was this page helpful?