Restricting Category Menu to two levels

4 posts by 2 authors in: Forums > CMS Builder
Last Post: August 30, 2010   (RSS)

Re: [aquaman] Restricting Category Menu to two levels

By theclicklab - August 28, 2010

Just discovered the third level is only showing when its parent is selected - if that helps.

Thanks
Jan

Re: [aquaman] Restricting Category Menu to two levels

By Chris - August 30, 2010

Hi Jan,

You can skip categories which are deeper than the second level by adding a line of code right after your foreach which checks the 'depth' field. Since depth starts at 0, you'll want to skip anything > 1:

<?php foreach ($pagesRecords as $record): ?>
<?php if ( $record['depth'] > 1 ) { continue; } ?>


I hope this helps! Please let me know if you have any questions.
All the best,
Chris

Re: [chris] Restricting Category Menu to two levels

By theclicklab - August 30, 2010

Hi Chris, Perfect! thanks so much!!