Limiting autonav to a single node

Permalink
Hi Guys,

After the help on here from Spiral and others, i got my nested lists working in autonav all nice.

Next challenge that has me slightly stuck is writing a custom template that only returns the pages under a given node in the sitemap tree.

I have set up one node which has 6 pages under it. These have all been excluded from the main nav using the "Exclude From Nav" attribute and I have added an additional attribute to each of these pages called "left_nav". I thought it would be as simple as doing a loop throuhg the pages and testing to see if the "left_nav" attribute was true and then spilt the details out when it is.

I started with the header_menu.php file as a base and tried using
defined('C5_EXECUTE') or die(_("Access Denied."));
   $aBlocks = $controller->generateNav();
   global $c;
   $nh = Loader::helper('navigation');
   foreach($aBlocks as $ni) {
      $_c = $ni->getCollectionObject();
      if ($_c->getCollectionAttributeValue('left_nav')) {
   ///do something here
}

but it doesn't seem to work.

Anyone got any other ideas on how I would achieve my objective?

Cheers

 
ben replied on at Permalink Reply
Wow - discussion has really picked up and my post has been buried - still haven't figured this one out if anyone has any ideas?
andrew replied on at Permalink Reply
andrew
You're definitely on the right track. I'm wondering if your autonav settings are correct.

1. If you remove the exclude from nav attribute on one of those pages, does the page show up in your autonav when you're previewing it? I'm wondering if the page itself isn't even being included in your set of pages, due to the autonav settings.

2. If these pages do get included, are you using a custom template on the autonav? Has it been set use "Use Custom Template" ?

3. What happens if you modify your custom template and print out the contents of the array created by generateNav()? Is there anything in there?