Predefined Liquid objects can be overridden by variables with the same name. To make sure that you can access all Liquid objects, make sure that your variable name doesn’t match a predefined object’s name.
assign
Creates a new variable.
You can create variables of any type, including strings, numbers, arrays, and objects.
The name of the variable to create.
The value to assign to the variable.
capture
Captures the string inside the tag and assigns it to a variable.
The capture
tag is useful when you want to combine multiple values into a single string.
The name of the variable to create.
The content to capture and assign to the variable.
increment
Creates a new number variable with an initial value of 0 and increments it by 1 every time it is called.
The increment
tag creates a new variable with its own scope, separate from variables created with assign
or capture
.
The name of the variable to increment.
decrement
Creates a new number variable with an initial value of -1 and decrements it by 1 every time it is called.
Like increment
, the decrement
tag creates a new variable with its own scope.
The name of the variable to decrement.