I'm looking to show parent categories that have children, but if parents have no children, I need to show channel entries for the parent cats using the same segment_3.

{if "child_categories"!=""}
   This Has Child Categories
   This Doesn't - Show Entries in Parent 

Edit: Trying this:

{exp:gwcode_categories cat_url_title="{segment_2}" max_depth="2"} 
{if '{has_children_in_output}' != ''} 
This Has Stuff Show Children Cats 
{if:else} This Doesn't Have Children - Show Entries for Parent Cat 
{/if} {/exp:gwcode_categories}

I'm just not sure whow to show entries inside GW Cat tags. Maybe I need to store GW output as a variable to reuse in a Channel Tag?

2 Answers 2


You should be aware that GWCode Categories has not been updated since 2012, and only works with EE2 (see more details here http://gwcode.com/add-ons/gwcode-categories/release-notes) - so while it is incredibly handy it is not a robust long-term solution.

Fortunately there is an alternatives - find out more here https://buzzingpixel.com/software/category-construct/documentation/template-tags

As for doing the conditional you are trying to do, you probably can do it using the {construct:has_children} tag - which would seem to do all you need.



For anyone else looking for a solution.

{exp:gwcode_categories cat_url_title="{segment_2}" max_depth="1" style="linear"}
{if '{has_children_in_output}' != ''}
{!-- Show Nothing --}
{exp:channel:entries channel="products" custom_fields="yes" category="{segment_category_ids}"}
          <!-- Your Stuff -->

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.