GWcode HasChildren Support

Avatar for Luke David

#1 By Luke David @ January 25th, 2012 19:01 (81 months ago)

Any idea's as to why this wouldn't work?


{exp:channel:categories channel="sales" style="linear"}
   {exp:gwcode_haschildren:check cat_url_title="{category_url_title}"}
   <li >{if gwcode_haschildren}{site_url}images/ico-arrowdn-a0a0a0.png{if:else}{/if}<div class="filter-checkbox"></div>{category_name}</li>
   
  {/exp:channel:categories}
Avatar for Leon Dijk

#2 By Leon Dijk @ January 25th, 2012 20:42 (81 months ago)

Hi Luke,

The plugin hasn't been designed to work that way. It's meant to be called only once, at the top of your template for one category only, not inside a loop.

I'll see if that's something I can change, but looking at your code, you're probably better off using GWcode Categories for what you're trying to accomplish. It allows you to loop through your categories and by using the "has_children" variable in an if conditional, you should be able to do what you want.

Avatar for Luke

#3 By Luke @ January 25th, 2012 21:03 (81 months ago)

Thanks for the quick response. I will give it a shot. Thanks for your contributions to the EE society!

Submit your comment

(Required)
(Required, will not be published)
(Optional)

Need to Post HTML Code?
- Use Postable to convert HTML to entities.
- Copy/paste Postable code in between <pre><code></code></pre> tags.

Remember my information
Send me an email when new comments are added