APIs & Integrations

Bodocean
Member

Exclude Filters from post_filter / Get array from post_filter

SOLVE

I was looking for something like:

{% set post_filters = {% post_filter "post_filter" %} %}

{% for filter in post_filters %} 
    {% if filter != 'Read' or filter != 'Listen'  %}
      <li> {{ filter }} </li>
    {% endif %}
{% endfor %}

Currently we have a Sidebar, which displays all Filters, but we want to exclude the Filter 'Read' and 'Listen'.
How would you guys approach this?

0 Upvotes
1 Accepted solution
Bodocean
Solution
Member

Exclude Filters from post_filter / Get array from post_filter

SOLVE

Fixed it with:

{% set my_topics = blog_topics(module.select_blog, 6) %}

{% for item in my_topics %}
  {% if item != 'Listen' and item != 'Read' and item != 'Watch' %}
  
    {{ item }}
  
  {% endif %}
{% endfor %}

View solution in original post

2 Replies 2
cbarley
HubSpot Alumni
HubSpot Alumni

Exclude Filters from post_filter / Get array from post_filter

SOLVE

@Thomas_Bodocean, thank you for sharing your code and glad you got it working!

0 Upvotes
Bodocean
Solution
Member

Exclude Filters from post_filter / Get array from post_filter

SOLVE

Fixed it with:

{% set my_topics = blog_topics(module.select_blog, 6) %}

{% for item in my_topics %}
  {% if item != 'Listen' and item != 'Read' and item != 'Watch' %}
  
    {{ item }}
  
  {% endif %}
{% endfor %}