Conditions (if/else)
Using a simple "if"
{% if client.isNewClient == true %}
<p>Congrats on your first order!</p>
{% endif %}Combining conditions
{% if client.isExistingClient == true and client.orderedRecently == true %}
<p>A fan of our brand, are we? :D</p>
{% endif %}
{% if client.isNewClient == true or client.orderedALongTimeAgo == true %}
<p>Congrats on your first order this year!</p>
{% endif %}Inverse condition with "unless"
Doing both with "if ... else"
Multiple conditions with "if ... elsif ... else"
Dispatch according to a single variable
Last updated
Was this helpful?
