In response to this issue where I needed more specific control over the output of the Category Archive Tag, I hacked together a new plugin, Category Sorted Entries:
It’s behavior is basically the same as the standard Category Archive Tag, but it adds parameters to filter the output by entry ID, category, and category group.
An entry may belong to categories in several category groups, but I may not want to display the category listing of all of those groups at the same time. For example, if I were using categories to generate a breadcrumb, I would only want the categories from my Navigation category group to be displayed, so I might use the plugin like this:
{exp:category_sorted_entries channel="courses" style="linear" show_empty="no" group_id="1" entry_id="5"}
{categories} {category_name} > {/categories}{entry_titles}{title}{/entry_titles}
{/exp:category_sorted_entries}
Or, maybe I want to display a list of related entries (via Playa) organized in a nested list by category. In that case, it helps to filter by entry_id (and use Playa’s :entry_ids tag). Then a syntax like this would be helpful:
{exp:category_sorted_entries channel="test" style="nested" show_empty="no" entry_id="3|4|5|6"}
{categories}
<h3>{category_name} ({category_id})</h3>
<p>{/categories}</p>
<p>{entry_titles}<br />
{title} ({entry_id})<br />
{/entry_titles}</p>
<p>{/exp:category_sorted_entries}
Or, perhaps I want to display entries listed by categories, but I don’t want the categories from a particular group (maybe an internal/private category scheme or navigation category group) to be displayed:
{exp:category_sorted_entries channel="test" style="nested" show_empty="no" group_id="not 4"}
Or, perhaps I want to display all the entries with category 1 from group 1, but I want them to be displayed in the hierarchy of category group 3:
{exp:category_sorted_entries channel="test" style="nested" show_empty="no" category="1" group_id="3"}
I welcome testing/feedback/critiques/suggestions, and I hope this plugin might be as useful for others as it is for me…