...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
Operator | Meaning | Work | Syntax |
---|
abs | Returns the absolute value of a number. | | |
append | Concatenates two strings and returns the concatenated value. | | Code Block |
---|
|
{{ "Hello " | append: "Carl" }}
|
Code Block |
---|
|
{{ "Welcome" | append: dynamicfields.name }} |
Code Block |
---|
|
{{ dynamicfields.name | append: " welcome!"}} |
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. | Operator | Meaning | Work | Syntax |
---|
== | equals |
| This operator can be used with dynamic fields 'as is' only to compare strings. Code Block |
---|
| {% if dynamicfields.name == 'alan' %}
alan
{% elsif dynamicfields.name == 'tom' %}
tom
{% else %}
catherine
{% endif %} |
|
...
Operator | Meaning | Work | Syntax |
---|
abs | Returns the absolute value of a number. | |
|
append | Concatenates two strings and returns the concatenated value. | |
Code Block |
---|
| {{ "Hello " | append: "Carl" }}
|
Code Block |
---|
| {{ "Welcome" | append: dynamicfields.name }} |
Code Block |
---|
| {{ dynamicfields.name | append: " welcome!"}} |
|
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. | |
Code Block |
---|
| {{ "my great title" | capitalize }} |
Code Block |
---|
| {{ dynamicfields.nome | capitalize }} |
|
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 nil values from an array. |
|
|
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.
Code Block |
---|
| {{ 16 | divided_by: 4 }}
|
Code Block |
---|
| {{ subTotal| divided_by: 4 }} |
|
downcase | Makes each character in a string lowercase. It does not affect strings that are already all lowercase. | |
Code Block |
---|
| {{ "Parker Moore" | downcase }} |
Code Block |
---|
| {{ dynamicfields.nome | downcase}} |
|
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". Code Block |
---|
| {% assign my_array = dynamicfields.userid | split: "," %}
{{ my_array.first }} |
Code Block |
---|
| {% assign my_array = "apples, oranges, peaches, plums" | split: ", " %}
{{ my_array.first }} |
|
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".
Code Block |
---|
| {% assign my_array = dynamicfields.userid | split: "," %}
{{ my_array | join: " and " }}
|
Code Block |
---|
| 1 and 2 and 3 and 4 and 5 |
Code Block |
---|
| {% assign beatles = "John, Paul, George, Ringo" | split: ", " %}
{{ beatles | join: " and " }} |
Code Block |
---|
| John and Paul and George and Ringo |
|
last | Returns the last item of an array. | | Assuming the userid dynamicfield contains "1,2,3,4,5". Code Block |
---|
| {% assign my_array = dynamicfields.userid | split: "," %}
{{ my_array.last}} |
Code Block |
---|
| {% assign my_array = "apples, oranges, peaches, plums" | split: ", " %}
{{ my_array.last }} |
|
lstrip | Removes all whitespaces (tabs, spaces, and newlines) from the beginning of a string. The filter does not affect spaces between words. | |
|
map | Creates an array of values by extracting the values of a named property from another object. | | Assuming the products contains:
Code Block |
---|
| {
"products": [{
"title": "Product 1",
"price": 100
}, {
"title": "Product 2",
"price": 200
}, {
"title": "Product 3",
"price": 300
}]
} |
Code Block |
---|
| {% assign all_titles = products | map: "title" %}
{% for item in all_titles %}
{{ item }}
{% endfor %} |
Code Block |
---|
| Product 1
Product 2
Product 3 |
|
minus | Subtracts a number from another number. | | Does not work on dynamicfields. Code Block |
---|
| {{ 4 | minus: 2 }} |
|
"mygreattitle"|capitalize My great title |
|
modulo | Returns the remainder of a division operation. | | Does not work on dynamicfields. |
dynamicfields.nomecapitalizeDoes not work on dynamicfields.
Luke |
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 nil values from an array. | | |
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. | |
Code Block |
---|
| {{ SubTotal | modulo: 6}} |
|
newline_to_br | Replaces every newline (\n ) with an HTML line break (<br> ). | |
|
plus | Adds a number to another number. | | Assuming the TotalIncome dynamic field contains 500. Code Block |
---|
| {{ dynamicfields.TotalIncome| plus: 2 }} |
|
16 divided_by4
titleOutput | 4 |
prepend | Adds the specified string to the beginning of another string. | | |
subTotal| divided_by: 4 "apples, oranges, and bananas" | prepend: "Some fruit: " }} |
|
|
100 |
downcase | Makes each character in a string lowercase. It has no effect on strings which are already all lowercase. | |
---|
| Some fruit: apples, oranges, and bananas |
Code Block |
---|
| {{ dynamicfields.Name| prepend: " |
|
ParkerMoore |downcase parkermoore
Code Block |
---|
| {{ dynamicfields. |
|
nome| downcaseprepend: dynamicfields.Surname}} |
|
luke |
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".
Code Block |
---|
| {{ "Welcome" | prepend: dynamicfields.Name }} |
|
remove | Removes every occurrence of the specified substring from a string. | |
Code Block |
---|
| {{ "I strained to see the train through the rain" | remove: "rain" }} |
Code Block |
---|
| I sted to see the t through the |
|
% assign my_array= userid split," %}
{{ my_array.first 1 |
{% assign my_array = "apples, oranges, peaches, plumssplit", " %}
{{ my_array.first applesfloor | 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". remove_first | Removes only the first occurrence of the specified substring from a string. | | |
%assign my_array = dynamicfields.userid | split: "," %}
{{ my_array | join: " and "I strained to see the train through the rain" | remove_first: "rain" }} |
|
1 and 2 and 3 and 4 and 5 |
I sted to see the train through the rain |
|
replace | Replaces every occurrence of an argument in a string with the second argument. | | |
% assign beatles = "John, Paul, George, Ringo "Take my protein pills and put my helmet on" | |
|
split %}
{{ beatles | join: " and JohnandPaulGeorgeandRingolast | Returns the last item of an array. | | Assuming the userid dynamicfield contains "1,2,3,4,5". |
replace_first | Replaces only the first occurrence of the first argument is a string with the second argument. | | |
array dynamicfields.userid "Take my protein pills and put my helmet on" %}
{{ my_string | |
|
splitreplace_first: "my", "your" |
|
%}
{{ my_array.last}}
Code Block |
---|
| Take your protein pills and put my helmet on |
|
reverse | Reverses the order of the items in an array. reverse cannot reverse a string. | |
|
round | Rounds an input number to the nearest integer or, if a number is specified as an argument, to that number of decimal places. | | Does not work on dynamicfields.
|
% assign my_array = "apples, oranges, peaches, plums" | split: ", " %}
{{ my_array.lastplumslstrip whitespaces whitespace (tabs, spaces, and newlines) from the |
beginning of a string. The filter does not affect spaces between wordsmap | 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.
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. size can also be used with dot notation (for example, {{ my_string.size }} ). This allows you to use size inside tags such as conditionals. | | |
4 "Ground control to Major Tom." | |
|
minus:2 2 |
Code Block |
---|
| {% assign my_array = "apples, oranges, peaches, plums" | split: ", " %}
{{ my_array |
|
SubTotal minus:100 900modulo the remainder of a division operation. | Does not work on dynamicfields.
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. | | |
3modulo2 1 |
Assuming title contains "Return to the future" |
SubTotal modulo64
newline_to_br | Replaces every newline (\n ) with an HTML line break (<br> ). | | |
plus | Adds a number to another number. | | |
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. | | |
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. reverse cannot reverse a string. | | |
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. size can also be used with dot notation (for example, {{ my_string.size }} ). This allows you to use size inside tags such as conditionals. | | |
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. | | | {{ dynamicfields.title| slice: 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. | | Same behavior of the sort_natural filter.
Code Block |
---|
| {% assign my_array = "zebra, octopus, giraffe, Sally Snake" | split: ", " %}
{{ my_array | sort_natural | join: ", " }} |
Code Block |
---|
| giraffe, octopus, Sally Snake, zebra |
|
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. | |
Code Block |
---|
| {% assign beatles = "John, Paul, George, Ringo" | split: ", " %}
{% for member in beatles %}
{{ member }}
{% endfor %} |
Code Block |
---|
| John
Paul
George
Ringo |
Assuming the dynamic field albumid contains "1,2,3,4,5" Code Block |
---|
| {% assign ids= dynamicfields.albumid | split: "," %}
{% for id in ids%}
{{ id }}
{% endfor %} |
|
strip | Removes all whitespace (tabs, spaces, and newlines) from both the left and right |
side sides of a string. It does not affect spaces between words. | |
|
strip_html | Removes any HTML tags from a string. |
| | |
Code Block |
---|
| {{ "Have <em>you</em> read <strong>Ulysses</strong>?" | strip_html }} |
Code Block |
---|
| Have you read Ulysses? |
|
strip_ |
html HTML tags newline characters (line breaks) from a string. | |
|
times | Multiplies a number by another number. | | Does not work on dynamicfields. |
| | | | | |
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_newlines | Removes any newline characters (line breaks) from a string. | | |
times | Multiplies a number by another number. | | |
truncate | truncate shortens a string down to the number of characters passed as a parameter. If the number of characters specified is less than the length of the string, an ellipsis (…) is appended to the string and is included in the character count.
| | |
truncate | truncate shortens a string down to the number of characters passed as a parameter. If the number of characters specified is less than the length of the string, an ellipsis (…) is appended to the string and is included in the character count.
| |
Code Block |
---|
| {{ "Ground control to Major Tom." | truncate: 20 }} |
Code Block |
---|
| Ground control to... |
Code Block |
---|
| {{ "Ground control to Major Tom." | truncate: 25, ", and so on" }} |
Code Block |
---|
| Ground control, and so on |
|
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. |
| |
|
uniq | Removes any duplicate elements in an array. |
| |
|
upcase | Makes each character in a string uppercase. It |
has no effect on strings which
does not affect strings that are already all uppercase. | |
Code Block |
---|
| {{ dynamicfields.name | upcase }}
|
|
{{ dynamicfields.name | upcase }}
|
|
url_decode | Decodes a string that has been encoded as a URL or by url_encode . |
| |
|
url_encode | Converts any URL-unsafe characters in a string into percent-encoded characters. |
| | upcase | Makes each character in a string uppercase. It has no effect on strings which are already all uppercase. | | |