Autonav hide top level if no children

Permalink
I want to display a mulitlevel nested list navigation using autonav, which is easily done.

But then I want to modify the template so that if a top level parent has no children it will not display in the list. Therefore only items with children will be displayed.

I've played around with getLevel() and getFirstChild() but can't get it to work.

mrnoisy
 
okhayat replied on at Permalink Reply
okhayat
Using any of the templates, just skip the ones that has no children.
Within the foreach loop (foreach($aBlocks as $ni) {
) add a line to check the number of children and 'continue' or skip if it's 0:
<?php
if ($_c->getNumChildren() == 0) continue;
?>