Auto Nav Woes

Permalink
Hi Guys

I hope someone can help as i'm about to give up on concrete5.

I am trying to generate a dropdown menu using the auto nav block.

This is the code I'm using in my theme:

<?php
      $bt = BlockType::getByHandle('autonav');
      $bt->controller->cParentID = '80';
      $bt->controller->displayPages = 'current';
      $bt->controller->orderBy = 'display_asc';
      $bt->render('view');
      ?>


If i use CparentID of 1 then it shows the homepage and the next top level page. However, when i replace this with the id of the actual page i want to target (that has 9 pages sitting under it according to the site map page) it generates nothing.

I am totally confused, have a client breathing down my neck and am seriously at the point of ditching concrete and going back to wordpress so if anyone can help redeem concrete for me and save the day i would very much appreciate some help.

Many thanks,

Jebediah

 
mesuva replied on at Permalink Reply
mesuva
As an idea, perhaps replace this with an editable area and add the Autonav as a block, instead of hardcoding it. You'd then have full control over the levels it displays.
(I've not hardcoded a nav like this before, so I'm not sure of what you are missing).

Then if you need to, you could set it to be 'global', across the site (so it doesn't become editable on every page), and/or set it as a page default.
Jebediah replied on at Permalink Reply
Thanks Mes

I've got it working now with that code though.

I had to replace the pages under the parent page and that seemed to do the trick - it's as if C5 wasn;t recognising the pages existed there even though the pages were showing as child pages in site map. Must just be an odd quirk but didn't have make me despair last night!

Thanks again for your suggestion - will try that option in future :)

Jeb