Global Bootstrap Navigation
Permalink
Hi everyone
I am currently concretizing a bootstrap theme for 5.7.4.2. - I have hardcoded the nav (because I don't want my customer to mess around with global areas) within the template. The code is below. Now I run into issues whenever a parent page has sub-pages: I would like parent to work as a "header" for the sub-pages without clickable page behind it.
I guess I will need to include a line of code .... ?
Any suggestions?
I am currently concretizing a bootstrap theme for 5.7.4.2. - I have hardcoded the nav (because I don't want my customer to mess around with global areas) within the template. The code is below. Now I run into issues whenever a parent page has sub-pages: I would like parent to work as a "header" for the sub-pages without clickable page behind it.
I guess I will need to include a line of code .... ?
Any suggestions?
<div class="main-navigation animated"> <nav class="navbar navbar-default"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <div class="collapse navbar-collapse" id="navbar-collapse-1"> <?php $nav = BlockType::getByHandle('autonav'); $nav->controller->orderBy = 'display_asc';
Viewing 15 lines of 25 lines. View entire code block.
Hi - thanks for your input.
I have replaced the hardcoded version by a global area as sugested. Permissions did not work, the page needed redirection. I discovered that I had to generate an - attribute to link to the first child page.
I have replaced the hardcoded version by a global area as sugested. Permissions did not work, the page needed redirection. I discovered that I had to generate an
replace_link_with_first_in_nav
Instead of hard coding the Auto-Nav, have you considered leaving them in global areas and locking down the permissions?
Also, hard coded blocks are not cached. This could affect performance on a large site.
http://c5blog.jordanlev.com/blog/2012/04/hard-coded-autonav-options...