GWcode HasChildren

Developer

Leon Dijk - GWcode

3rd Party (Free)

Creative Commons Attribution Non-Commercial No Derivatives

EE Version Support

  • ExpressionEngine 2

Compatibility

If an item is crossed out, it might be untested, not applicable or incompatible. Contact the developer to be sure.

  • Updater
  • Multi Site Manager
  • Stand Alone Entry Form
  • Low Variables
  • Content Elements
  • Better Workflow
  • Matrix
  • Grid
  • Webservice
  • Publisher

Requirements

  • jQuery for the Control Panel

Add-On Type(s)

Plugin

Tags

This light-weight plugin allows you to check if a category has child categories and then use the result in a conditional. You could for example show some content when a category has child categories and some other content when it doesn't.

First, make sure you call the plugin to check if a category has child categories.
You only have to do this once in the template, somewhere at the top for example:

{exp:gwcode_haschildren:check group_id="1" cat_url_title="{segment_3}"}

Then, you can use conditionals like this in your template:

{if gwcode_haschildren}
	The currently viewed category has child categories! Show something.
{if:else}
	No child categories! Show something else.
{/if}

More information can be found here.

GWcode HasChildren Links

This entry was created December 15, 2011, 9:53 am.
This entry was last updated October 4, 2012, 8:41 am.

Disclaimer: Information about ExpressionEngine add-ons is provided as a service to you, the user, and every member of the ExpressionEngine community. devot:ee is not responsible if you hose, mangle, wreck, or otherwise destroy your EE website by installing an add-on that you found out about at this site, regardless of its rating, Favorites status, commercial or free status, or general popularity. Caveat EEmptor!

Returns: devot:ee has a 30-day return policy on all commercial add-ons sold through devot-ee.com. If you need to return an add-on, do not go to the developer or the developer's site, but rather visit our returns page at https://devot-ee.com/returns to initiate your return. If you have questions, email support@devot-ee.com.

3 Reviews:

OwanH 05.28.12

OwanH
Rating - {addon_rating_average}

A very nice little add-on that saved my bacon today. Much thanks to the developer.

Mark Bowen Design 12.16.11

Mark Bowen Design
Rating - {addon_rating_average}

Great little add-on. In the past I’ve had to use the query module in a template to achieve this sort of thing. Have always been meaning to create a plugin to do this and share it with the world but I’m positive Leon’s will always be a million times better than mine ;-) Great work again Leon.

Brian Coult 12.15.11

Rating - {addon_rating_average}

Have to say this is a fantastic little add on that solves the problem of only showing child categories of a parent or if not showing something else.. used to great effect on a photography site i did recently.. great support too