shopifyliquidliquid-template

How to target multiple templates in liquid unless statement


{% unless template == "templatename1" and "templatename2" %}

or {% if template == "templatename1" , "templatename2" %}

I would like to target "templatename2" as well but In this code, only "templatename1" is working.


Solution

  • You need to repeat the condition after the and. And it's a or because template cannot be both 1 and 2.

    {% unless template == "templatename1" or template == "templatename2" %}
    {% if template == "templatename1" or template == "templatename2" %}