How to target multiple templates in liquid unless statement

Adnan Malik

{% 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.

Fabio Filippi

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" %}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related