Manually coding the autonav and changing display

Permalink 1 user found helpful
I'm putting the autnav directly into a template as I am trying to modify a template using a dropdown menu. The autonav is inserted with this code:

$bt = BlockType::getByHandle('autonav');
            $bt->controller->displayPages = 'top';
            $bt->controller->orderBy = 'display_asc';                    
            $bt->controller->displaySubPages = 'all'; 
            $bt->controller->displaySubPageLevels = 'custom';
            $bt->controller->displaySubPageLevelsNum = '3';   
            $bt->render('templates/header_menu_dropdown');


My question is about this line: $bt->controller->displayPages = 'top';

How can I change that to be loading pages below a certain level instead of the top?

AltaPlanning
 
Ekko replied on at Permalink Reply
Ekko
Change it to second or third
AltaPlanning replied on at Permalink Reply
AltaPlanning
Is that literally?

$bt->controller->displayPages = 'second';


That doesn't seem right but I'm not sure what all the possible choices are for displayPages.

Plus, I'm looking to have the secondary and tertiary menus under a specific page. We do this because we have multiple sites running under one instance of C5 using domain mapper.
Ekko replied on at Permalink Reply
Ekko
Use the page name "contact" "about". Try it, and see if it works out for you. The options should be exactly whats called for in the nav block. Display pages "top" "second" , and under specific page should be page name. Best thing to do is try it, and see if its right.
jmcgarvey replied on at Permalink Reply
jmcgarvey
Did you ever get this working? I am trying to do something similar.
zoinks replied on at Permalink Reply
Where did you find this code? I'd like to know all the options for hardcoding an autonav. One would naturally look at the auto-nav page in the documentation, of course, but I did that and saw no such information.

EDIT: found it thanks again to Jordan Lev, man of the hour 24/7...
http://c5blog.jordanlev.com/blog/2012/04/hard-coded-autonav-options...