Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
If post has specific topic not working
Regular Contributor
04-19-2018 05:29
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
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content