Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Basics

Operators

(warning) TODO: gli operatori funzionano sui valori degli endpoint, da verificare sui campi dinamici (dynamicfields.)

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  

 

Example

{% if product.title == "Awesome Shoes" %}
  These shoes are awesome!
{% endif %}
{% if product.type == "Shirt" or product.type == "Shoes" %}
  This is a shirt or a pair of shoes.
{% endif %}

 

Truthy and falsy

TBD

Types

TBD

TAGS

Comment

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

Control flow

TBD

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

Filters

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 }}
    

 

 

  • No labels