{% comment %}

Comments will be hidden My name is {% comment %}Mark{% endcomment %} Dunkley My name is Dunkley

{% raw %}

No liquid will be parsed in within these tags {% raw %} {{mustache.js}} {% endraw %}

{% if %}

"If" statements let you determine if something is true or not if username is elvis {% if user.name == 'elvis' %}

hey Elvis

{% endif %} hey Elvis Else if example {% if user.name == 'elvis' %}

hey elvis

{% elsif user.name == 'Mark' %}

hey mark

{% else %}

hi stranger

{% endif %} hey ugly

{% unless %}

If not true, then it will do something username is not "elvis" {% unless user.name == 'elvis' %}

hey ugly

{% endunless %} hey ugly

{% case %}

Used when you have consistent cases of something case [handle is 'cookie'] {% case handle %}

{% when 'cake' %}

This is a cake

{% when 'cookie' %}

This is a cookie

{% else %}

This is not a cookie/cake

{% endcase %} This is a cookie

{% cycle %}

Use when you need to alternate between something. Basic example {% cycle 'one', 'two' %}

{% cycle 'one', 'two' %}

{% cycle 'one', 'two' %} one

two

one Group cycles {% cycle 'group 1': 'one', 'two', 'three' %}

{% cycle 'group 1': 'one', 'two', 'three' %}

{% cycle 'group 2': 'one', 'two', 'three' %}

{% cycle 'group 2': 'one', 'two', 'three' %}

one two one two

{% for %}

Use "for loops" if you want to repeat/test something over and over limit:

offset: Loop options For Loop [product are: hat, pez, pad] {% for product in collection.products %}

{{ product.name }},

{% endfor %} hat, pez, pad, Limit [product are: hat, pez, pad] {% for product in collection.products limit:2 %}

{{ product.name }},

{% endfor %} hat, pez,

{% tablerow %}

Generate table rows/cells cols:

limit: You have a few options Example [products are: hat, pez, pad] <table>

{{% tablerow product in collection.products cols: 2 %}

<td>

{{ product.title }}

</td>

{% endtablerow %}

</table> <table>

<tr>

<td>hat</td>

<td>pez</td>

</tr>

<tr>

<td>pad</td>

</tr>

</table>



{% assign %}

Create variables {% assign myvariable = false %}

{% if myvariable != true %}

The if statement is valid

{% endif %} The if statement is valid

{% increment %} New

Creates a new variable and everytime it's called the value increases by 1, with the initial value being 0 {% increment variablename %}

{% increment variablename %} 0

1

{% decrement %} New

Creates a new variable and everytime it's called the value decreases by 1, with the initial value being -1 {% decrement variablename %}

{% decrement variablename %} -1

-2

{% capture %}

Similar to {% assign %} and allows you to "capture" a variable you output {% capture productlink %}

{% product.url %}

{% endcapture %}



{% productlink %} /products/apple

{% include %}