So I want to group a list of events by tags feild. Some of them have multiple tags. I want to create headings on the page with each tag in an H2 and then articles that have that tag listed underneath.
But its for kirby 2 not 3 and i dont know the tag name up front, i just want to group articles together by tag under a heading for each tag. It doesnt matter if an article gets listed twice in two seperate groups if it has more than one tag.
I think the best way would be to pluck the tags with the unique parameter set to false and then count how many times each tag is contained in the resulting array. The alternative would be to filter the collection by each tag and then count the result, but performance-wise that is not really recommendable.