Filtering blog posts with 2 tags on listing template

Hello,

I am using a custom blog template where I want to create a nested filter system for my blog https://learn.commonsku.com/.

Basically, I want it to go through 2 different filter types:

  1. By Role: Management, Sales, Finance, Production
  2. By Learning Style: Video, eBooks & Guides, Podcasts, Blog Posts

Right now, I have this separate blog commonsku Blog | Growth Strategies for Promo Distributors as the homepage to choose the role, and when you click on one role type, it directs to another blog with that role tag selected.

For example, if I click on Management, it will open this page: commonsku Learn | Management. From here, I need posts with Management tag to be filtered again with a learning style (Video, eBooks & Guides, Podcasts, Blog Posts). But when I click on a filter it goes to https://learn.commonsku.com/tag/filter-selected and it unselects management tag.

How can I filter my blog posts with 2 tags selected in this style of navigation?

Hi @LKim6,

This is not a feature HubSpot supports by default but it’s possible.

To make this happen, you should work something out like this:

  • Use the /all blog page so all blog articles will load.
  • Use query parameters with the request.query_dict to fetch selected tags
  • Make a custom module to make a list of current tags and make them dynamic with the query parameters
  • Use the blog_recent_tag_posts to set multiple tags and list them.
  • If you want to add a pagination, you need to slice them up and also use query parameters for creating a pagination.