Blog, Website & Page Publishing

APG
Member

How to restrict tags displaying on blog listing page

I am trying to restrict what tags display on the blog listing page. I want to be able to add more tags but not have them dispay at the listing page level and be filterable by the user.

In the HubL code I have the following;

 

{% if not simple_list_page %}
<div class="custom-categories">
{% set my_topics = blog_topics('group.id', 😎 %}
<ul>
<li class="tab-all active">
<a href="{{ group.absolute_url }}">All</a>
</li>
{% for item in my_topics %}
<li><a href="{{ blog_tag_url(group.id, item.slug) }}">{{ item }}</a></li>
{% endfor %}
</ul>
</div>
{% endif %}

0 Upvotes
1 Reply 1
mike-ward
Key Advisor

How to restrict tags displaying on blog listing page

Hi @APG ,

 

What's the issue that you're having? What does it render and how does it compare to what you expect? Can you share a demo page or preview link to help with debugging? What is the group variable shown in your code below, how is it defined?

 

The code below looks like it should give you the first 8 tags. What do you get from it? If you want to only display a subset of those tags, you probably just need to create an array of the 'main' tags you want to display and compare against those with an extra conditional checks. 

 

Thanks,

Mike

 

---

Did I answer your question? If your question is answered, please mark it as a solution. If you need more help, hit that big orange 'Reply' button!

0 Upvotes