ItemTags not rendering in liquid control tags?

Hey, maybe I am losing my mind, but I can’t seem to get Liquid Control Tags, more specifically IF to render content based on a condition? More specifically again, I am trying to render a condition using the Events Module.

{% component source: "Event", layout: "Events Page List", limit: "1", object: "collection", collectionVariable: "test", type: "module" %}

{% for item in test.items %}
{% if item.ItemTags == 'TCYBA Logo' %}
<p>I am a TCYBA Logo Tag</p>
{% else %}
<p>I don't have a tag</p>
{% endif %}
{% endfor %}

<pre>{{test}}</pre>

What this renders is: http://prntscr.com/nf0zil

Raw Liquid Collection info is there, as you can see in the screenshot. So, am I missing something, losing my mind, or are ItemTags & ItemCategories not available to be rendered within a control tag. @Eugene

The tags and categories are stored as arrays so you’d need to loop through those as well to check against each one.
Something like:

{% for item in test.items %}
    {% for tag in item.itemtags %}
    {% if tag == 'TCYBA Logo' %}
    ...

Or, if you just want to check if tags are present you could do:
{% if item.ItemTags.size > 0 %}

1 Like

Right, array totally forgot about that! Thanks @Adam.Wilson!

Can’t wait until we get out {{this|JSON}} equivalent it’ll make issue like this so much easier to solve.

1 Like

Totally worked - thanks again Adam!

1 Like