If post has specific topic not working


#1

Hi,

I'm trying to get a conditional statement working that I found here - https://designers.hubspot.com/docs/tutorials/how-to-check-for-a-particular-topic-on-a-blog-post

However this doesn't seem to be working whether I use name or slug. I know for sure I'm using the correct name as I have a different conditional statement that checks the topic array list's first value and it matches the name I'm using.

So for example

{% set topictag = content.topic_list[0] %}
{% if topictag == "Growing your business" %}
     Returns True
{% endif %}

However this

{% if 'Growing your business' in content.topic_list|map('name') %}
    True
{% else %}
     False
{% endif %}

Returns false. Any ideas on why this would be?

Thanks


#2

I'm being a dummy.

Had the wrong name and the first conditional was using => rather than ==

All working now.

Thanks.