Autonav Drop Down
Permalink
Hey guys, I am finding that when I use autonav blocks within a template as opposed to inserting a autonav block via editable new area, that the layout's differ.
When you insert the autonav block via adding to an area, it is formatted correctly:
<ul>
<li><a href="">Parent Link</a>
<ul>
<li><a href="">Child Link</a></li>
</ul>
</li>
</ul>
But if you insert the autonav block within a template. It gives you this
<ul>
<li><a href="">Parent Link</a></li>
<li><a href="">Child Link</a></li>
</ul>
I need the format to be first example as i need a drop down.
The code I am using to insert the block is:
$bt_menu = BlockType::getByHandle('autonav');
$bt_menu->controller->displayPages = 'top';
$bt_menu->controller->orderBy = 'display_asc';
$bt_menu->controller->displayPagesCID = '0';
$bt_menu->controller->displaySubPages = 'all';
$bt_menu->controller->displaySubPageLevels = 'custom';
$bt_menu->controller->displaySubPageLevelsNum = '1';
$bt_menu->render('templates/header_menu');
Am i doing something wrong?
Thanks in advance!
When you insert the autonav block via adding to an area, it is formatted correctly:
<ul>
<li><a href="">Parent Link</a>
<ul>
<li><a href="">Child Link</a></li>
</ul>
</li>
</ul>
But if you insert the autonav block within a template. It gives you this
<ul>
<li><a href="">Parent Link</a></li>
<li><a href="">Child Link</a></li>
</ul>
I need the format to be first example as i need a drop down.
The code I am using to insert the block is:
$bt_menu = BlockType::getByHandle('autonav');
$bt_menu->controller->displayPages = 'top';
$bt_menu->controller->orderBy = 'display_asc';
$bt_menu->controller->displayPagesCID = '0';
$bt_menu->controller->displaySubPages = 'all';
$bt_menu->controller->displaySubPageLevels = 'custom';
$bt_menu->controller->displaySubPageLevelsNum = '1';
$bt_menu->render('templates/header_menu');
Am i doing something wrong?
Thanks in advance!
Thanks for the quick reply Kino. I duplicated the view page as i was making cosmetic changes to it, such as adding classes, but essentially it is still the same as the view.php file and it still didn't work.
sorry.
change to
change to
$bt_menu->render('view');
this meen using 'concrete/blocks/autonav/templates/header_menu.php'
to
this meen using 'concrete/blocks/autonav/view.php'