BoldMinded acquires Ansel, support ending for all add-ons. BoldMinded acquires Ansel, support ending for all add-ons. Read More →
Support has been discontinued. Issues remain available as an archive. Support has been discontinued. Issues remain available as an archive.
construct:has_children help
#134 opened by Greg Wineman
Description
This is the only code on my page... I i'm POSITIVE cat_id 1 has children, but the plugin isn't seeing them with the "has_children" tag.
The following code always returns false
{exp:category_construct:categories cat_id="1" }
{if construct:has_children}
This category has children!
{if:else}
This category has NO children!
{/if}
{/exp:category_construct:categories}
this code works and returns 4 subcategories for category 1:
{exp:category_construct:categories parent_id="1"}
<option value="{construct:cat_name}">{construct:cat_name}</option>
{/exp:category_construct:categories}
The code above is the only code on the template. What am I missing?
Replies
- TJ Draper
Replied 11/30/2018 11:38 AM, Edited 11/30/2018 11:40 AM
Unfortunately with the way Category Construct is currently written, there is no way for it to know if there are children when you use the
cat_id
parameter. Try theparent_id_with_children
tag param. - Greg Wineman
Replied 11/30/2018 11:40 AM
Yaaaas! Thank you for the fast response. That did the trick.