4

I'm scratching my head to find the best way to output a nested category list that contains channel entries for child cats...something like this


h1 Parent Category Name

    h2 Child Category Name 1
        Channel Entry 1 in Child Category
        Channel Entry 2 in Child Category
        More Channel Entries in category....

    h2 Child Category Name 2
        More Channel Entries in Child Category.....


 h1 Parent Category Name
     .....

I'm thinking the only way to get the job done would be stash or php, but the solutions I've found so far don't do seem to handle this kind of nested category setup

any ideas?

2

Default category handling in EE can be limited so I'd highly recommend GWCode Categories. It's free, very versatile, and well documented. You could achieve your nested categories as simply as:

{exp:channel:entries channel="example" disable="categories|member_data|pagination"}
    <b>{title}</b><br />
    {exp:gwcode_categories entry_id="{entry_id}"}
        {group_heading}{cat_group_name}{/group_heading}
        {cat_name}
    {/exp:gwcode_categories}
{/exp:channel:entries}

Example here.

2
  • Wow-what an add-on! Thanks for the tip. I used it with a combination of embeds to get what I need. Maybe not the most performance-friendly way to go, but it'll work for now. – mjr Mar 28 '13 at 14:58
  • I agree here: GWCode Categories is fantastic; that's why it was selected as an Editor's Pick on devot:ee. – Ryan Masuga Mar 28 '13 at 15:06
0

NSM Categories might be able to do what you need.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.