Hi
I’m creating a blog listing that places articles in different places on the page on the basis of certain tags, e.g. “Featured” and “Pinned”:
{% for content in contents %}
{% if 'Pinned' in content.topic_list|map('name') %}
My pinned article
{% endif %}
{% endfor %}
{% for content in contents %}
{% if 'featured' in content.topic_list|map('name') %}
My featured article
{% endif %}
{% endfor %}
{% for content in contents %}
{% if ['Pinned' , 'Featured'] not in content.topic_list|map('name') %}
All the other articles
{% endif %}
{% endfor %}
For the last “all other articles” section this works fine if there is one tag defined tag:
{% if 'Featured' not in content.topic_list|map('name') %}
But not if there are two:
{% if ['Pinned' , 'Featured'] not in content.topic_list|map('name') %}
Is my code wrong here?
Thanks for any help here!