CMS Development

kenwhm
Member

Displaying blog post tags and hiding certain ones

Hi there,

 

I am trying to display a list of all the tags used on hubspot blog posts but hide certain ones.

 

This is what I am currently doing:

 

     {{ blog_tags('default', 250) }}

      {% set my_tags = blog_tags('default', 250) %}
      <ul>
      {% for item in my_tags %}
        {% if !item.name is containing "Digital Transformation" or "Retail" %} 
          <h3><a href="{{ blog_tag_url(group.id, item.slug) }}">{{ item }}</a></h3>
        {% endif %}

      {% endfor %}
      </ul>

I am trying to find a way to add an OR statement but it doesn't seem to work. Any way to edit this code and make it work or is there a different way? 

Thanks in advance!

0 Upvotes
1 Reply 1
lscanlan
HubSpot Alumni
HubSpot Alumni

Displaying blog post tags and hiding certain ones

I believe this post was a duplicate of https://community.hubspot.com/t5/CMS-Development/blog-tags-function-to-get-only-certain-tags/m-p/297.... Just adding the link here in case anyone comes across this post looking for a similar solution.

Leland Scanlan

HubSpot Developer Support
0 Upvotes