I have 3 category parents with several children in each.

For a single entry product page, I would like to list which categories the product belongs to (children only), with a single header for each category parent:

Publisher: (parent id 22) Designer: (parent id 45) Genre: (parent id 8)

There could be multiple children categories for Designer and Genre.

Ideally I would like to use conditional statements that spit out:

if publisher is checked then <p>Publisher: <a href="#">publishercategoryname</a> </p>

if designer is checked then <p>Publisher: <a href="#">designercategoryname1</a>, <a href="#">designercategoryname2</a>, <a href="#">designercategoryname3</a> </p>

if genre is checked then <p>Genre(s): <a href="#">genrecategoryname1</a>, <a href="#">genrecategoryname2</a>, <a href="#">genrecategoryname3</a> </p>

I would like the parent to show up just once, with the children category names nested.

Any help would be greatly appreciated.


2 Answers 2


Whilst you can do some complicated stuff with GW Categories, I would probably first use separate category groups for these three things instead of nesting parent-child categories. It would simplify things greatly and create better separation of concerns, since your top-level categories are not semantically related to each other - you're basically just faking headings which would be better suited as individual category groups.

{exp:channel:entries channel="example" disable="categories|member_data|pagination"}
    {exp:gwcode_categories entry_id="{entry_id}" style="linear"}
       {if group_start}<p>{cat_group_name}: {/if}
       <a href="{path=category/{cat_url_title}}">{cat_name}</a>
       {if group_end}</p>{if:else} ,{/if}
  • I agree with you. I just created new category groups for each, instead of using parents. Still not sure how to code it so that I can get the categories for each group id listed though. They may not always be populated, so needs a conditional, and I want them listed with the group id name only once. Any thoughts? Commented Mar 24, 2013 at 13:35
  • edited answer to add an example - as with most things to do with EE categories, using the GW plugin will make this easier. Commented Mar 24, 2013 at 16:19

This excellent add-on http://devot-ee.com/add-ons/gwcode-categories will do exactly what you need. Check it out!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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