Best practice to get content by multiple tags
# help-with-umbraco
r
I'm looking to use tags to help me filter content on the site and looking at https://docs.umbraco.com/umbraco-cms/13.latest/reference/querying/itagquery. What I want is to be able to pull content back based on multiple tags. There's a function for GetContentByTag which accepts a tag and group, but only a single tag. How would people go about searching by multiple tags? I have a working solution where I use GetContentByTagGroup and then perform additional filtering based on the tag - but looping over my tags and calling GetContentByTag for each would also do the trick. This feels like a fairly standard use case and I wondered what other people have been doing?
j
We have a few sites where we use tags, and on some we have a dropdown to select a tag / clicking a tag on a card in a listview filters to that tag. For sites where you need to be able to filter by multiple tags we move away from the ITagQuery and instead use examine to filter with as it quickly becomes hard to manage.
r
Cracking, thanks for the input @Jemayn !
11 Views