testing unless

Just testing an unless solution from SlackOverflow

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

Gives this output

unless print only if constrain is not met.

This prints nothing:

This prints “No Z”: No Z

Posted in [ tech ]
Edit this page