Check a category/node has children or not


New member
What is the code to check a node has children or not? Currently i can get the node depth by {$node.depth} but how to find it's a parent of other node?

Jake Bunce

XenForo moderator
Staff member
There is no explicit "is parent" flag for nodes, but this should work:

{$node.rgt} == {$node.lft} + 1
If this condition is true then the node has no children. You can use this in a template conditional:

<xen:if is="{$node.rgt} == {$node.lft} + 1">