Reputation: 618
I'm trying to achieve something quite simple.
My code is the following:
{% if template != 'index' or template != 'page.jump' %}
I then want to do something if the template isn't equal to those two pages.
However, it doesn't seem to be interpreting anything after or
Either of these work individually, and I've had to resort to nesting if statements which is nasty.
Is there any reason why template
won't work with the or
operator in a liquid template?
Upvotes: 0
Views: 5925
Reputation: 1
For the liquid it works perfectly in 2 conditions:
Example:
{% if product.type == 'Bundle' and product.type != 'Dress'%}
Upvotes: 0
Reputation: 900
Try the "and" operator.
{% if template != "index" and template != "page.jump" %}
There seems to be another way around here: How to use multiple arguments in an if statement with Liquid
Upvotes: 4