Twitter Bootstrap Navigation Tabs With Autonav
Permalink 1 user found helpful
I've been trying to use the Twitter Bootstrap tabs (http://twitter.github.com/bootstrap/#navigation) with c5, but I'm not adept enough at PHP to get the autonav block to output the correct markup. It should be like this...
Any suggestions?
<ul class="tabs"> <li class="active"><a href="#">Home</a></li> <li><a href="#">Profile</a></li> <li><a href="#">Messages</a></li> <li><a href="#">Settings</a></li> <li><a href="#">Contact</a></li> <li class="dropdown" data-dropdown="dropdown"> <a href="#" class="dropdown-toggle">Dropdown</a> <ul class="dropdown-menu"> <li><a href="#">Secondary link</a></li> <li><a href="#">Something else here</a></li> <li><a href="#">Another link</a></li> </ul> </li> </ul>
Any suggestions?
I tried to use jordanlevs autonav template, but it indiscriminately assigns a class to "items" with child pages, but I need to assign different classes to the li, a, and ul as you can see in the code above.
I wasn't suggesting that this view would solve your problems, but that it would be a better starting point for modifying the php into what you re trying to achieve.
Hey,
I had the same problem but managed to figure it out (not sure its the best way, but it works for me) using code from http://www.packtpub.com/article/concrete5-mastering-autonav-for-adv...
Put this in your www_root/blocks/autonav/view.php file
Hope it helps. If anyone can improve it please do so :-D
I had the same problem but managed to figure it out (not sure its the best way, but it works for me) using code from http://www.packtpub.com/article/concrete5-mastering-autonav-for-adv...
Put this in your www_root/blocks/autonav/view.php file
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); // get the list of all pages matching the selection $aBlocks = $controller->generateNav(); $nh = Loader::helper('navigation'); echo("<ul class=\"nav\">"); // loop through all the pages foreach($aBlocks as $ni) { $_c = $ni->getCollectionObject(); // get the level of the current element. // This is necessary to create the proper indentation. $thisLevel = $ni->getLevel(); // the current page has a higher level than the previous // page which means that we have to print another UL // element to indent the next pages
Viewing 15 lines of 61 lines. View entire code block.
Hope it helps. If anyone can improve it please do so :-D
Ooops just noticed you wanted it for Bootstrap Tabs. Well, same principle applies just need to change the classes as the above code is for the Drop Down Menu in Twitter Bootstrap 2
http://www.concrete5.org/community/forums/customizing_c5/new-cleane...
and
http://www.concrete5.org/documentation/how-tos/developers/change-th...
for a starting point on how to override the default.