# Excluding articles from a blog listing

**URL:** <https://community.hubspot.com/t/excluding-articles-from-a-blog-listing/96184>\
**Category:** CMS Development\
**Created:** [December 15, 2023, 11:55am UTC](https://community.hubspot.com/t/excluding-articles-from-a-blog-listing/96184 "2023-12-15T11:55:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DM2](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dm2/32/39641_2.png) [@DM2](https://community.hubspot.com/u/DM2)\
**Post date:** [December 15, 2023, 11:55am UTC](https://community.hubspot.com/t/excluding-articles-from-a-blog-listing/96184/1 "2023-12-15T11:55:00Z")

</div>

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”:

```lia-code-sample
{% 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!

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [December 15, 2023, 11:06pm UTC](https://community.hubspot.com/t/excluding-articles-from-a-blog-listing/96184/2 "2023-12-15T23:06:12Z")

</div>

Hey, @DM2 👋 Thanks for the great question! I’d like to invite some of our HubL elves to the conversation — @BarryGrennan @miljkovicmisa @Brownstephen101, do you have any HubL-themed gifts for @DM2?

Best,

Jaycee

---

<div class="post-metadata">

**Author:** ![DM2](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dm2/32/39641_2.png) [@DM2](https://community.hubspot.com/u/DM2)\
**Post date:** [December 18, 2023, 9:00am UTC](https://community.hubspot.com/t/excluding-articles-from-a-blog-listing/96184/3 "2023-12-18T09:00:05Z")

</div>

OK so as a workaround this works; but I’m not sure it’s an entirely elegant solution? If anyone has a more concise approach I would be interested:

```lia-code-sample
{% for content in contents %}	
 {% if 'Featured' not in content.topic_list|map('name') %}		
 {% if 'Pinned' not in content.topic_list|map('name') %}

All the other articles...			

 {% endif %}		
 {% endif %}
{% endfor %}		

```
