I’m also interested in knowing if there’s a slicker way of doing this.
In any event, I’m just getting started with EE myself, but, I was able to accomplish something like this by using some nested queries:
This will loop through all of the parent categories in the “events” channel, and send each category ID to a template:
{exp:channel:categories channel="events" parent_only="yes" style="linear"}
{embed="site/sub-list-categories-parents" parent_id="{category_id}"}
{/exp:channel:categories}
Here’s the template referenced above. It will display the name of the category and list all of the entries in that category. Then, it will call another template, which will do the same thing for it’s children.
sub-list-categories-parents:
{exp:query sql="SELECT cat_name, cat_id FROM exp_categories WHERE cat_id={embed:parent_id}"}
<h2>Entries in parent category {cat_name}</h2>
<p> {exp:channel:entries channel="events" category={embed:parent_id}}<br />
<!-- whatever content you want to show --><br />
{/exp:channel:entries}</p>
<p> {embed="site/sub-list-categories-children" parent_id="{embed:parent_id}"}<br />
{/exp:query}
Do the same thing for the children of the category called above…
sub-list-categories-children:
{exp:query sql="SELECT cat_name, cat_id FROM exp_categories WHERE parent_id={embed:parent_id}"}
<h2>Entries in child category {cat_name}</h2>
<p> {exp:channel:entries channel="events" category={embed:parent_id}}<br />
<!-- whatever content you want to show --><br />
{/exp:channel:entries} <br />
{/exp:query}
I hope that’s useful for you.