Basics
Operators
...
Operator | Meaning | Work | Syntax (forse togliamo questa colonna?) | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
== | equals | It is possible use this operator with dynamic fields 'as is' only to compare strings.
In this case the check is case sensitive. To compare numbers or data type different from string it is possible use the built in functions:
| ||||||||||||||||
!= | does not equal | It is possible use this operator with dynamic fields 'as is' only to compare strings.
In this case the check is case sensitive. To compare numbers or data type different from string it is possible use the built in functions:
| ||||||||||||||||
> | greater than | It is possible use this operator with dynamic fields 'as is' only to compare strings.
In this case the check is case sensitive. To compare numbers or data type different from string it is possible use the built in functions:
| ||||||||||||||||
< | less than | It is possible use this operator with dynamic fields 'as is' only to compare strings.
In this case the check is case sensitive. To compare numbers or data type different from string it is possible use the built in functions:
| ||||||||||||||||
>= | greater than or equal to | It is possible use this operator with dynamic fields 'as is' only to compare strings.
In this case the check is case sensitive. To compare numbers or data type different from string it is possible use the built in functions:
| ||||||||||||||||
<= | less than or equal to | It is possible use this operator with dynamic fields 'as is' only to compare strings.
In this case the check is case sensitive. To compare numbers or data type different from string it is possible use the built in functions:
| ||||||||||||||||
or | logical or |
| ||||||||||||||||
and | logical and |
| ||||||||||||||||
contains | checks for the presence of a substring inside a string |
|
...
Operator | Meaning | Work | Syntax |
---|---|---|---|
comment | Any text within the opening and closing comment blocks will not be output, and any Liquid code within will not be executed | Yes | {% comment %} Text {% endcomment %} |
...
Operator | Meaning | Work | Syntax | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
if | Executes a block of code only if a certain condition is | Yes |
| unless | Executes a block of code
| |||||||||||
unless | Executes a block of code only if a certain condition is not me match | Yes |
| elsif/else | Adds more conditions within an
| |||||||||||
elsif/else | Adds more conditions within an if or unless block. |
| case/when | Creates a switch statement to compare a variable with different values |
| |||||||||||
case/when | Creates a switch statement to compare a variable with different values |
|
Iteration
TBD
Variable
TBD
Filters
...
Operator | Meaning | Work | Syntax | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
abs | Returns the absolute value of a number. | ||||||||||||||||||||||||||||||||||||||||||
append | Concatenates two strings and returns the concatenated value. |
| |||||||||||||||||||||||||||||||||||||||||
at_least | Limits a number to a minimum value. | ||||||||||||||||||||||||||||||||||||||||||
at_most | Limits a number to a maximum value. | ||||||||||||||||||||||||||||||||||||||||||
capitalize | Makes the first character of a string capitalized. |
| |||||||||||||||||||||||||||||||||||||||||
ceil | Rounds the input up to the nearest whole number. Liquid tries to convert the input to a number before the filter is applied. | ||||||||||||||||||||||||||||||||||||||||||
compact | Removes any | ||||||||||||||||||||||||||||||||||||||||||
concat | Concatenates (joins together) multiple arrays. The resulting array contains all the items from the input arrays. | ||||||||||||||||||||||||||||||||||||||||||
date | Converts a timestamp into another date format. The format for this syntax is the same as strftime . The input uses the same format as Ruby’s Time.parse . | ||||||||||||||||||||||||||||||||||||||||||
default | Allows you to specify a fallback in case a value doesn’t exist. default will show its value if the left side is nil , false , or empty. | ||||||||||||||||||||||||||||||||||||||||||
divided_by | Divides a number by the specified number. | Does not work on dynamicfields.
| |||||||||||||||||||||||||||||||||||||||||
downcase | Makes each character in a string lowercase. It has no effect on strings which are already all lowercase. |
| |||||||||||||||||||||||||||||||||||||||||
escape | Escapes a string by replacing characters with escape sequences (so that the string can be used in a URL, for example). It doesn’t change strings that don’t have anything to escape. | ||||||||||||||||||||||||||||||||||||||||||
escape_once | Escapes a string without changing existing escaped entities. It doesn’t change strings that don’t have anything to escape. | ||||||||||||||||||||||||||||||||||||||||||
first | Returns the first item of an array. | Assuming the userid dynamicfield contains "1,2,3,4,5".
| |||||||||||||||||||||||||||||||||||||||||
floor | Rounds a number down to the nearest whole number. Liquid tries to convert the input to a number before the filter is applied. |
| |||||||||||||||||||||||||||||||||||||||||
join | Combines the items in an array into a single string using the argument as a separator. | Assuming the userid dynamicfield contains "1,2,3,4,5".
| |||||||||||||||||||||||||||||||||||||||||
last | Returns the last item of an array. | Assuming the userid dynamicfield contains "1,2,3,4,5".
| |||||||||||||||||||||||||||||||||||||||||
lstrip | Removes all whitespaces (tabs, spaces, and newlines) from the beginning of a string. The filter does not affect spaces between words. | TODO: dovrebbe funzionare | |||||||||||||||||||||||||||||||||||||||||
map | Creates an array of values by extracting the values of a named property from another object. |
| |||||||||||||||||||||||||||||||||||||||||
minus | Subtracts a number from another number. | Does not work on dynamicfields.
| |||||||||||||||||||||||||||||||||||||||||
modulo | Returns the remainder of a division operation. | Does not work on dynamicfields.
| |||||||||||||||||||||||||||||||||||||||||
newline_to_br | Replaces every newline ( | ||||||||||||||||||||||||||||||||||||||||||
plus | Adds a number to another number. | Assuming the TotalIncome dynamic field contains 500.
| |||||||||||||||||||||||||||||||||||||||||
prepend | Adds the specified string to the beginning of another string. |
| |||||||||||||||||||||||||||||||||||||||||
remove | Removes every occurrence of the specified substring from a string. |
| |||||||||||||||||||||||||||||||||||||||||
remove_first | Removes only the first occurrence of the specified substring from a string. |
| |||||||||||||||||||||||||||||||||||||||||
replace | Replaces every occurrence of an argument in a string with the second argument. |
TODO: aggiungere esempi con campi dinamici! | |||||||||||||||||||||||||||||||||||||||||
replace_first | Replaces only the first occurrence of the first argument in a string with the second argument. | ||||||||||||||||||||||||||||||||||||||||||
reverse | Reverses the order of the items in an array. | ||||||||||||||||||||||||||||||||||||||||||
round | Rounds an input number to the nearest integer or, if a number is specified as an argument, to that number of decimal places. | ||||||||||||||||||||||||||||||||||||||||||
rstrip | Removes all whitespace (tabs, spaces, and newlines) from the right side of a string. | TODO: dovrebbe funzionare | |||||||||||||||||||||||||||||||||||||||||
size | Returns the number of characters in a string or the number of items in an array. | ||||||||||||||||||||||||||||||||||||||||||
slice | Returns a substring of 1 character beginning at the index specified by the argument passed in. An optional second argument specifies the length of the substring to be returned. String indices are numbered starting from 0. | ||||||||||||||||||||||||||||||||||||||||||
sort | Sorts items in an array by a property of an item in the array. The order of the sorted array is case-sensitive. | ||||||||||||||||||||||||||||||||||||||||||
sort_natural | Sorts items in an array by a property of an item in the array. | ||||||||||||||||||||||||||||||||||||||||||
split | Divides an input string into an array using the argument as a separator. split is commonly used to convert comma-separated items from a string to an array. | ||||||||||||||||||||||||||||||||||||||||||
strip | Removes all whitespace (tabs, spaces, and newlines) from both the left and right side of a string. It does not affect spaces between words. | TODO: dovrebbe funzionare | |||||||||||||||||||||||||||||||||||||||||
strip_html | Removes any HTML tags from a string. | ||||||||||||||||||||||||||||||||||||||||||
strip_newlines | Removes any newline characters (line breaks) from a string. | ||||||||||||||||||||||||||||||||||||||||||
times | Multiplies a number by another number. | ||||||||||||||||||||||||||||||||||||||||||
truncate |
| ||||||||||||||||||||||||||||||||||||||||||
truncatewords | Shortens a string down to the number of words passed as the argument. If the specified number of words is less than the number of words in the string, an ellipsis (…) is appended to the string. | TODO: dovrebbe funzionare | |||||||||||||||||||||||||||||||||||||||||
uniq | Removes any duplicate elements in an array. | ||||||||||||||||||||||||||||||||||||||||||
upcase | Makes each character in a string uppercase. It has no effect on strings which are already all uppercase. |
| |||||||||||||||||||||||||||||||||||||||||
url_decode | Decodes a string that has been encoded as a URL or by | ||||||||||||||||||||||||||||||||||||||||||
url_encode | Converts any URL-unsafe characters in a string into percent-encoded characters. |
...