Supportlogo-header

03:34AM, Apr 05, 2006

Kenzie Member

conditional and/or

Can someone explain to me how to make an if/or condition for shopify. Here’s what I’m trying to accomplish:

{ if template 'cart' or template ‘product’) } ... { endif }

NOTE: My equals/percent signs aren’t being displayed in the forum.

This works if I use one statement or the other, but not both using “or” or ”||”.

Kenzie

03:55PM, Apr 09, 2006

tobi Shopify

Liquid doesn’t yet have full boolean expressions.

In the meantime i would just use case for this:

{% case template %}
{% when 'cart' %}
    ..
{% when 'product' %}
    ..
{% endcase %}
Tobias Lütke - Shopify CEO // http://twitter.com/tobi

login or Sign up for an account to reply.