Does Liquid have a “does not contain” or “not in array” operator?

unless to the rescue !

Create an [A, B, C] array.

{% assign input = "A,B,C" | split:"," %}

unless print only if constrain is not met.

This prints nothing:

{% unless input contains 'A' %}No A{% endunless %}

This prints “No Z“:

{% unless input contains 'Z' %}No Z{% endunless %}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)