Hi,
I'm defining a variable:
{% set activePage = "foo bar" %}
Then I have some html:
<body class="{{activePage}}">
Which gives me:
<body class="foo bar">
I'd like to check if 'activePage' contains at least 'foo' (and not necessarily 'bar'), but obviously this returns false:
{%if activePage == 'foo' %}
How could I check if the variable holds just one of those class names?
Thanks.
{% if 'foo' in activePage %} should work.
Most helpful comment
{% if 'foo' in activePage %}should work.