...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
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 %} |
In this case, the check is case-sensitive. To compare numbers or data types different from a string it is possible to use the built-in functions: Code Block |
---|
| {% assign c1 = dynamicfields.name| evaltext: 'equalTo', 'Jennifer' %} {% if c1 == true %} Text {% endif %} |
Code Block |
---|
| {% assign c1 = dynamicfields.age | evalinteger: 'equalTo', '8' %} {% if c1 == true %} Text {% endif %} |
|
!= | does not equal | | It is possible to use this operator with dynamic fields 'as is' only to compare strings. Code Block |
---|
| {% if dynamicfields.name != 'alan' %}
alan
{% elsif dynamicfields.name != 'tom' %}
tom
{% else %}
catherine
{% endif %} |
In this case, the check is case-sensitive. To compare numbers or data types different from a string it is possible to use the built-in functions: Code Block |
---|
| {% assign c1 = dynamicfields.name| evaltext: 'otherThan', 'Jennifer' %} {% if c1 == true %} Text {% endif %} |
Code Block |
---|
| {% assign c1 = dynamicfields.age | evalinteger: 'otherThan', '8' %} {% if c1 == true %} Text {% endif %} |
It is possible use the operator to check if the dynamic field is empty or contains a value.
Code Block |
---|
| {% if dynamicfields.name != '' %}
Valued
{% else %}
empty
{% endif %} |
It is possible do the same using the built-in functions: Code Block |
---|
| {% assign c1 = dynamicfields.name| evaltext: 'otherThan', '' %} {% if c1 == true %} valued {% endif %} |
|
> | greater than | | It is possible to use this operator with dynamic fields 'as is' only to compare strings. Code Block |
---|
| {% if dynamicfields.name > 'alan' %}
alan
{% elsif dynamicfields.name > 'tom' %}
tom
{% else %}
catherine
{% endif %} |
In this case, the check is case-sensitive. To compare numbers or data types different from a string it is possible to use the built-in functions: Code Block |
---|
| {% assign c1 = dynamicfields.name| evaltext: 'moreThan', 'Jennifer' %} {% if c1 == true %} Text {% endif %} |
Code Block |
---|
| {% assign c1 = dynamicfields.age | evalinteger: 'moreThan', '8' %} {% if c1 == true %} Text {% endif %} |
|
< | less than | | It is possible to use this operator with dynamic fields 'as is' only to compare strings. Code Block |
---|
| {% if dynamicfields.name |
|
==< 'alan' %}
alan
{% elsif dynamicfields.name |
|
==< 'tom' %}
tom
{% else %}
catherine
{% endif %} |
In this case, the check is case-sensitive. To compare numbers or data |
type types different from a string it is possible to use the built-in functions: Code Block |
---|
| {% assign c1 = dynamicfields.name| evaltext: ' |
|
equalTolessThan', 'Jennifer' %} {% if c1 == true %} Text {% endif %} |
Code Block |
---|
| {% assign c1 = dynamicfields.age | evalinteger: ' |
|
equalTolessThan', '8' %} {% if c1 == true %} Text {% endif %} |
|
!does not greater than or equal to | | It is possible to use this operator with dynamic fields 'as is' only to compare strings. Code Block |
---|
| {% if dynamicfields.name |
|
!>= 'alan' %}
alan
{% elsif dynamicfields.name |
|
!>= 'tom' %}
tom
{% else %}
catherine
{% endif %} |
In this case, the check is case-sensitive. To compare numbers or data |
type types different from a string it is possible to use the built-in functions: Code Block |
---|
| {% assign c1 = dynamicfields.name| evaltext: ' |
|
otherThanequalOrMoreThan', 'Jennifer' %} {% if c1 == true %} Text {% endif %} |
Code Block |
---|
| {% assign c1 = dynamicfields.age | evalinteger: ' |
|
otherThanequalOrMoreThan', '8' %} {% if c1 == true %} Text {% endif %} |
|
>greater less than or equal to | | It is possible to use this operator with dynamic fields 'as is' only to compare strings. Code Block |
---|
| {% if dynamicfields.name |
|
><= 'alan' %}
alan
{% elsif dynamicfields.name |
|
><= 'tom' %}
tom
{% else %}
catherine
{% endif %} |
In this case, the check is case-sensitive. To compare numbers or data |
type types different from a string it is possible to use the built-in functions: Code Block |
---|
| {% assign c1 = dynamicfields.name| evaltext: ' |
|
moreThanequalOrLessThan', 'Jennifer' %} {% if c1 == true %} Text {% endif %} |
|
assign c1 = assign c1 = dynamicfields.age | evalinteger: 'equalOrLessThan', '8' %} {% if c1 == true %} Text {% endif %} |
|
or | logical or | |
Code Block |
---|
| {% if dynamicfields.name == 'alan' or dynamicfields.age |
|
| evalinteger:moreThan', '8child' %}
is alan or a child
{% |
|
if c1 == true %} Text else %}
It is an adult alan or another adult
{% endif %} |
|
<less than | | It is possible use this operator with dynamic fields 'as is' only to compare strings.logical and | |
Code Block |
---|
| {% if dynamicfields.name |
|
< %}
alan
{% elsifname<tom
tom
alan is a child
{% else %} |
|
catherine
it is an adult
{% endif %} |
|
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: |
contains | checks for the presence of a substring inside a string | | |
assign c1 =|evaltext:lessThan', 'Jenniferoof' %}
could be alan?
{% |
|
ifc1== true %} Textsurely isn't alan
{% endif %} |
|
Type | Meaning | Work | Syntax |
---|
String | Declare a string by wrapping a variable’s value in single quotes: | | |
c1dynamicfields.age | evalinteger: 'lessThan', '8'%ifc1== true %} Text {% endif %}>= | greater than or equal to | | It is possible use this operator with dynamic fields 'as is' only to compare strings.
Code Block |
---|
| THIS IS A STRING |
|
Number | Numbers include floats and integers: | | |
ifdynamicfields.name>'alan'
alan
%elsifdynamicfields.name >= 'tom' %}
tom
{% else %}
catherine
{% endif %}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:c1dynamicfields.name| evaltext: 'equalOrMoreThan', 'Jennifer' %ifc1==true%} Text {% endif %}
Code Block |
---|
| 8.23400020599365 |
|
Boolean |
| | |
c1dynamicfields.age | evalinteger: 'equalOrMoreThan', '8' %if c1 == true %} Text {% endif %}<= | less than or equal to | | It is possible use this operator with dynamic fields 'as is' only to compare strings.ifdynamicfields.name<'alan'
alan% elsif dynamicfields.name <= 'tom' %}
tom
%else%
catherine
{% endif %}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: |
Nil | Nil is a special empty value that is returned when the Liquid code has no results. It is not a string with the characters “nil”. Nil is treated as false in the conditions of if blocks and other Liquid tags that check the truthfulness of a statement. | | |
assignc1= dynamicfields.name| evaltext: 'equalOrLessThan', 'Jennifer' %}if c1 == true %} Text {% endif %}assignc1 = dynamicfields.age | evalinteger: 'equalOrLessThan', '8' {%ifc1 == true %} Textendifor | logical or |
Array | Arrays hold lists of variables of any type. | | |
if dynamicfields.name =assign my_array = 'alan,catherine,tom,erin,mark' |
|
or dynamicfields.age == 'child
is alan or a child
{% else %}
It is an adult alan or another adult
{% endif %}and | logical and | | Code Block |
---|
| {% if dynamicfields.name == 'alan' and dynamicfields.age == 'child' %}
alan is a child
{% else %}
it is an adult
{% endif %} |
|
contains | checks for the presence of a substring inside a string | | Code Block |
---|
| {% if dynamicfields.name contains 'oof' %}
could be alan?
{% else %}
surely isn't alan
{% endif %} |
|
Type | Meaning | Work | Syntax |
---|
String | Declare a string by wrapping a variable’s value in single quotes: | | Code Block |
---|
|
{% assign thisIsAString = 'this is a string' %}
{{ thisIsAString | upcase }} {{ my_array.first }}
{{ my_array.last }} |
Code Block |
---|
| {% assign my_array = 'alan,catherine,tom,erin,mark' | split: ',' %}
{% for user in my_array %}
{{ user }}
{% endfor %} |
Code Block |
---|
| alan catherine tom erin mark |
Code Block |
---|
| {% assign my_array = 'alan,catherine,tom,erin,mark' | split: ',' %}
{{ my_array[2] }} |
|
...
Operator | Meaning | Work | Syntax |
---|
if | Executes a block of code only if a certain condition is true | | |
thisIsAnIntegerc1 = dynamicfields.age| evalinteger: 'equalTo', '10' %}
{ |
|
{thisIsAnInteger|minus:2} 8assignthisIsAFloat 10.234{{thisIsAFloat| minus: 2 }} 8.23400020599365 |
Boolean | |
unless | Executes a block of code only if a certain condition is not match | | |
languagexmlthisIsTrue c1 = dynamicfields.age| evalinteger: 'equalTo', '10' %}
{% unless c1 == true %}
|
|
{{ thisIsTrue }Not 10 years old
{% endunless %} |
|
trueassignthisIsFalsetrue{thisIsFalse}false |
Nil | Nil is a special empty value that is returned when Liquid code has no results. It is not a string with the characters “nil”.
Nil is treated as false in the conditions of if
blocks and other Liquid tags that check the truthfulness of a statement |
elsif/else | Adds more conditions within an if or unless block. | | |
user dynamicfields.name == 'alan' %}
alan
{% elsif dynamicfields.name == 'tom' %}
tom
|
|
Hello user!{% else %}
catherine
{% endif %} |
Code Block |
---|
language | xml |
---|
title | output if name is goofy |
---|
| alan |
Code Block |
---|
language | xml |
---|
title | output if name is tom |
---|
| tom |
|
title | Output |
title | output for each other name |
---|
| catherine |
|
case/when | Creates a switch statement to compare a variable with different values | | |
languagexml unless user case dynamicfields.name%}
{% when 'alan' %}
|
|
Hellouser!{%endunless %}Array | Arrays hold lists of variables of any type. | | Code Block |
---|
|
{% assign my_array = 'alan,catherine,tom,erin,mark' | split: ',' %}
{{ my_array.first }}
{{ my_array.last }} |
Code Block |
---|
|
{% assign my_array = 'alan,catherine,tom,erin,mark' | split: ',' %}
{% for user in my_array %}
{{ user }}
{% endfor %}a alan
{% when 'tom' %}
This is a tom
{% else %}
This is not a alan nor a tom. can it be a catherine?
{% endcase %} |
|
Output | alan catherine tom erin mark |
Code Block |
---|
|
{% assign my_array = 'alan,catherine,tom,erin,mark' | split: ',' %}
{{ my_array[2] }}Output | tom |
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 | | for | Repeatedly executes a block of code. | | |
Text 1 {% comment %} Text 2 | {% assign my_array = 'alan,catherine,tom,erin,mark' | split: ',' %}
{% for user in my_array %}
{{ user }}
{% |
|
endcomment Text 1 |
Operator | Meaning | Work | Syntax |
---|
if | Executes a block of code only if a certain condition is true | alan catherine tom erin mark |
|
break | Causes the loop to stop iterating when it encounters the break tag. | | |
c1dynamicfields.age'alan,catherine,tom,erin,mark' | |
|
evalintegerequalTo', '10',' %}
{% for user in my_array %}
{% if |
|
c1true10 years oldendif Code Block |
---|
|
{% if dynamicfields.name == 'alan' %}
alan
{{ user }}
{% endif %}
{% |
|
endifExecutes a block of code only if a certain condition is not match
Code Block |
---|
| alan catherine tom |
|
unless | continue | Causes the loop to skip the current iteration when it encounters the continue tag. | | |
c1 dynamicfields.age| evalinteger 'alan,catherine,tom,erin,mark' | split: ' |
|
equalTo', '10',' %}
{% for user in my_array %}
{% |
|
unlessc1trueNot 10 years oldendunless Code Block |
---|
|
Not 10 years old |
Code Block |
---|
|
{% unless dynamicfields.name == 'alan' %}
alan
{{ user }}
{% endif %}
{% |
|
endunless
Code Block |
---|
| alan catherine tom mark |
|
elsif/else | Adds more conditions within an if
or unless
block |
limit | Limits the loop to the specified number of iterations. | | |
if dynamicfields.name =assign my_array = 'alan,catherine,tom,erin,mark' | split: ',' %} |
|
alanelsifdynamicfields.name == 'tom'tom%else%
catherineendifoutput if name is goofy Code Block |
---|
language | xml |
---|
title | output if name is mickey |
---|
|
tom |
code |
offset | Begins the loop at the specified index. | | |
output for each other name | catherine |
case/when | Creates a switch statement to compare a variable with different values | | case dynamicfields.name%}
{% when 'alan assign my_array = 'alan,catherine,tom,erin,mark' | split: ',' %}
{% for user in |
|
This is a alan
my_array offset:2 %}
{{ user }}
{% |
|
when 'tom' %}
This is a tom
{% else %}
This is not a alan nor a tom. can it be a catherine?
{% endcase %} This is a alan |
range | Defines a range of numbers to loop through. The range can be defined by both literal and variable numbers. | |
Code Block |
---|
| {% for i in (3..5) %}
{{ i }}
{% endfor %} |
|
output if name is goofy | output if name is mickey | This is a tom |
Code Block |
---|
language | xml |
---|
title | output for each other name |
---|
|
This is not a alan nor a tom. can it be a catherine? |
Operator | Meaning | Work | Syntax |
---|
Cycle | Repeatedly executes a block of code. | |
Code Block |
---|
| {% assign my_array = 'alan,catherine,tom,erin,mark' | split: ',' %}
{% for user in my_array %}
{% |
|
ifuser == 'erin' %}
{% break %}
{% else %}
{{ user }}
{% endif %} in my_array %}
'first one', 'second one', 'third one' %}
{% endfor %} |
|
alan catherine tom |
continue | Causes the loop to skip the current iteration when it encounters the continue tag. | | Code Block |
---|
|
{% assign my_array = 'alan,catherine,tom,erin,mark' | split: ',' %}
{% for userfirst one second one third one first one second one |
|
Operator | Meaning | Work | Syntax |
---|
assign | Creates a new variable | |
Code Block |
---|
| {% assign c1 = 10 %}
{% if |
|
user'erin'continue
Code Block |
---|
| {% assign c1 = 'alan' %}
{% |
|
else{{user }}
%}
{% endforalancatherine tom marklimit | Limits the loop to the specified number of iterations |
capture | Captures the string inside of the opening and closing tags and assigns it to a variable. Variables created through {% capture %} are strings. | | |
my_array 'alan,catherine,tom,erin,mark' | split: ',' %} dynamicfields.name %}
{% assign surname = dynamicfields.surname %}
{% |
|
for user in my_array limit:2capture about_me %}
I am {{ |
|
username }} {{ surname }} and my favorite food is pizza.
{% |
|
endforoffset | Begins the loop at the specified index. | {% assign my_array = 'alan,catherine,tom,erin,mark' | split: ',' %}
{% for user in my_array offset:2 %}
{{ user }}
{% endfor %} |
range | Defines a range of numbers to loop through. The range can be defined by both literal and variable numbers | I am Catherine Martin and my favorite food is pizza. |
|
increment | Creates a new number variable, and increases its value by one every time it is called. The initial value is 0. | |
|
decrement | Creates a new number variable, and decreases its value by one every time it is called. The initial value is -1. | |
|
...
...
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 has no effect on strings which are already all lowercase. |
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. |
"ParkerMoore"|downcase
parker moore |
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" |
modulo | Returns the remainder of a division operation. | | Does not work on dynamicfields. |
% assign my_array = dynamicfields.userid | split: "," %}
{{ my_array.first 1 |
%assignmy_array = "apples, oranges, peaches, plums" | split: ", " %}
{{ my_array.first |
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 }} |
|
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".
Code Block |
---|
| {{ 5| plus: 2 }} |
|
prepend | Adds the specified string to the beginning of another string. | | |
%assign my_array = dynamicfields.userid | split: "," %}
{{ my_array | join: " and"apples, oranges, and bananas" | prepend: "Some fruit: " }} |
Code Block |
---|
| Some fruit: apples, oranges, and bananas |
Code Block |
---|
| {{ dynamicfields.Name| prepend: "Hello " }} |
|
1 and 2 and 3 and 4 and 5 |
% assign beatles = "John, Paul, George, Ringo" | split: ", " %}
{{ beatles | join: " and " }} { dynamicfields.Name| prepend: dynamicfields.Surname}} |
Code Block |
---|
| {{ "Welcome" | prepend: dynamicfields.Name }} |
|
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". |
remove | Removes every occurrence of the specified substring from a string. | |
Code Block |
---|
| {{ "I strained to see the train through the rain" | remove: "rain" }} |
|
Input | {% assign my_array = dynamicfields.userid | split: "," %}
{{ my_array.last} | I sted to see the t through the |
Code Block |
---|
| {{ dynamicfields.Name| remove: "uk"}} |
|
5
{% assign my_array = "apples, oranges, peaches, plums" | split: ", " %}
{{ my_array.last {{"Luke Skywalker" | remove: dynamicfields.Name}} |
|
plumslstrip 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. | | |
minus | Subtracts a number from another number. | | Does not work on dynamicfields.only the first occurrence of the specified substring from a string. | | |
4 "I strained to see the train through the rain" | |
|
minus2 2 |
I sted to see the train through the rain |
|
replace | Replaces every occurrence of an argument in a string with the second argument. | | |
SubTotal "Take my protein pills and put my helmet on" | |
|
minus 100900 |
modulo | Returns the remainder of a division operation. | | Does not work on dynamicfields.
Code Block |
---|
|
{{ 3 | modulo: 2
Take your protein pills and put your helmet on |
|
replace_first | Replaces only the first occurrence of the first argument is a string with the second argument. | |
Code Block |
---|
| {% assign my_string = "Take my protein pills and put my helmet on" %}
{{ my_string | replace_first: "my", "your" }} |
|
1 |
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.
|
SubTotalmodulo:64 |
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.
|
rstrip | Removes all whitespace (tabs, spaces, and newlines) from the right side of a string. | |
|
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. | | |
dynamicfields.TotalIncome| plus: 2 "Ground control to Major Tom." | size }} |
|
502 |
Code Block |
---|
| {% assign my_array = "apples, oranges, peaches, plums" | split: ", " %}
{{ my_array |
|
5plus: 27prepend | Adds the specified string to the beginning of another string |
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. | | |
apples, oranges, and bananasprepend"Some fruit: " |
Some fruit: apples, oranges, and bananas |
Assuming title contains "Return to the future" |
dynamicfields.Nameprepend"Hello " Hello Luke |
Code Block |
---|
| {{ dynamicfields. |
|
Nameprependdynamicfields.SurnameOutputLuke Skywalker
Code Block |
---|
|
{{ "Welcome" | prepend: dynamicfields.Name }} |
remove | Removes every occurrence of the specified substring from a string. | | |
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.
|
{"I strained to see the train through the rain" | remove: "rain" }} Code Block |
---|
|
I sted to see the t through the |
Code Block |
---|
|
{{ dynamicfields.Name| remove: "uk"assign my_array = "zebra, octopus, giraffe, Sally Snake" | split: ", " %}
{{ my_array | sort_natural | join: ", " }} |
|
Le |
Code Block |
---|
|
{{"Luke Skywalker" | remove: dynamicfields.Name}} |
remove_first | Removes only the first occurrence of the specified substring from a stringgiraffe, 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. | | |
{ "I strained to see the train through the rain" | remove_first: "rain" }% assign beatles = "John, Paul, George, Ringo" | split: ", " %}
{% for member in beatles %}
{{ member }}
{% endfor %} |
|
Istedtoseethetrainthrough the rainreplace | Replaces every occurrence of an argument in a string with the second argument. |
Assuming the dynamic field albumid contains "1,2,3,4,5" |
{ "Take my protein pills and put my helmet on"% assign ids= dynamicfields.albumid | |
|
replace"my "your}} Code Block |
---|
|
Take your protein pills and put your helmet on |
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. 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 | %}
{% for id in ids%}
{{ id }}
{% endfor %} |
|
strip | 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. | | |
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 | 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.
| | |
TODO: dovrebbe funzionareand newlines) from both the left and right 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_newlines | Removes any newline characters (line breaks) from a string. | |
|
times | Multiplies a number by another number. | | Does not work on dynamicfields.
Code Block |
---|
| {{ 24 | times: 7 }} |
|
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 }}
|
|
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. | |
|