Filtering blog post by two independent tags

Hi,

I’m trying to use Kirby for a blog. I want to be able to have two dropdown boxes at the top of the page to filter the posts.
Let’s say the first group of tags is Level(low, med, high) and the second (Cat1, Cat2, Cat3, Cat4) how do I go about looping through two sets of tag/categories?

I’ve tried following Show pages by filtering multiple tags? but I think its slightly different to what I’m after.

I’m ok with the html/css/js just need help with the actual php loop to filter the post by the 2 cats

any help would be greatly appriciated.

Thanks

Check out the docs: https://getkirby.com/docs/solutions/filtering#using-filters-with-forms-e-g-select-fields

1 Like

Hi texnixe,

That link is for a shop, how would this work with a blog type page where I need to return posts based on two categories?

I need something similar to this Filtering multiple tags

thanks again

1 Like

The example texnixe sent you is not limited to a shop.
If you read through the link you’ll see it shows you a situation where filtering by several keys is required. The fact that the example filters by size and color when you want to filter by level and category shouldn’t stop you from adapting the code.

Give it a try ! The interesting bits are in the controller.