EllisLab text mark
Advanced Search
     
Displaying & limiting Category Archives by multiple category groups
Posted: 03 January 2011 09:06 PM   [ Ignore ]
Joined: 2007-05-30
171 posts

I have two category groups assigned to a channel. I want to show a Category Archive based on Group B, but I only want to list entries that also belong to a specific category in Group A.

For example, say I had Category Group A...

- sweet drinks
- un-sweet drinks

and Category Group B...

- tea
- coffee
- milk
- juice

I want to list all my un-sweet drinks, organized by the Group B categories.

Is there any way to accomplish this with EE’s native category features?

(I have considered using conditionals to show/hide every entry individually, but that would be very ugly performance-wise…)

 
Posted: 03 January 2011 09:57 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2007-05-30
171 posts

(Edit: Using conditionals isn’t even a viable option, because I don’t want to show empty categories. Rats.)

 
Posted: 17 January 2011 03:40 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2007-05-30
171 posts

I ended up hacking together a new plugin to accomplish this: http://michaelrog.com/ee/category-sorted-entries

It behaves just like the Category Archive Tag, but allows for filtering by entry_id and category id, and it allows you to restrict the display to a specified category group(s).