Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Basics

Operators

...

OperatorMeaningWorkSyntax (forse togliamo questa colonna?)
==equals(tick)

 

!=does not equal(tick) 
>greater than(tick) 
<less than(tick) 
>=greater than or equal to(tick) 
<=less than or equal to(tick) 
orlogical or(tick) 
andlogical and(tick) 
containschecks for the presence of a substring inside a string (tick) 

 

Example

 

Code Block
{% if product.title == "Awesome Shoes" %}
  These shoes are awesome!
{% endif %}

...

OperatorMeaningWorkSyntax
commentAny 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 %}

...

OperatorMeaningWorkSyntax
if

Executes a block of code only if a certain condition is true

Yes{% assign c1 = dynamicfields.name| evaltext: 'equalTo', 'Jennifer' %} {% if c1 == true %} Text {% endif %}
unlessExecutes a block of code only if a certain condition is not meYes {% assign c1 = dynamicfields.name| evaltext: 'equalTo', 'Jennifer' %} {% unless c1 == true %} Text {% endunless %}
elsif/elseAdds more conditions within an if or unless block.  
case/whenCreates a switch statement to compare a variable with different values  

Iteration

TBD

Variable

TBD

...

OperatorMeaningWorkSyntax
append yes

{{ "Hello " | append: "Carl" }}

{% assign c1 = dynamicfields.name %} {{ "Hello" | append: c1 }}

{{ "Hello " | append: dynamicfields.name }}

upcase

Makes each character in a string uppercase. It has no effect on strings which are already all uppercase.

Yes{{ dynamicfields.name | upcase }}
    

...