Nav Code with relative path to parent
Permalink
Hello,
I'm looking to get a snippet of code that I can put directly into my markup that will generate navigation on a set of pages underneath a parent.
For example. I have 1 website splash page that goes into 2 different sub sites. Each sub site is in it's own directory. Within that directory, there are sub pages. I'd like each sub site to have a navigation only with the pages underneath it.
MAIN SITE
- Sub Site 1
- page 1
- page 2
- page 3
- Sub Site 2
- page 1
- page 2
- page 3
The current code I'm using is this:
<?
$bt_main = BlockType::getByHandle('autonav');
$bt_main->controller->cParentID = 199;
$bt_main->controller->displayPages = 'current';
$bt_main->controller->orderBy = 'display_asc';
$bt_main->controller->displaySubPages = 'all';
$bt_main->controller->displaySubPageLevels = 'custom';
$bt_main->controller->displaySubPageLevelsNum = '1';
$bt_main->render('templates/dropdown');
?>
As you can see, I have the cParentID set to 199. I did that just temporarily until I figure out a fix.
Any thoughts or suggestions.
Thanks in advance for your help!
I'm looking to get a snippet of code that I can put directly into my markup that will generate navigation on a set of pages underneath a parent.
For example. I have 1 website splash page that goes into 2 different sub sites. Each sub site is in it's own directory. Within that directory, there are sub pages. I'd like each sub site to have a navigation only with the pages underneath it.
MAIN SITE
- Sub Site 1
- page 1
- page 2
- page 3
- Sub Site 2
- page 1
- page 2
- page 3
The current code I'm using is this:
<?
$bt_main = BlockType::getByHandle('autonav');
$bt_main->controller->cParentID = 199;
$bt_main->controller->displayPages = 'current';
$bt_main->controller->orderBy = 'display_asc';
$bt_main->controller->displaySubPages = 'all';
$bt_main->controller->displaySubPageLevels = 'custom';
$bt_main->controller->displaySubPageLevelsNum = '1';
$bt_main->render('templates/dropdown');
?>
As you can see, I have the cParentID set to 199. I did that just temporarily until I figure out a fix.
Any thoughts or suggestions.
Thanks in advance for your help!