Navbar Tabs for CMS Sections
*********** obsolete from VB 4.2 - see my post #24 for the much better way of doing it using Andreas' extension to the new Nav Manager *************
The lack of ability to put links to CMS sections as tabs in the Navbar seems a bizarre oversight, however... solved to some extent although pretty clunky: This will work if you are adding navbar tabs for a top level section, ie. one that is not a sub section of your CMS home. That tab will then become 'selected' for that section, subsections and articles. It can probably we adapted for other situations. Anything in CAPS below needs to be filled in with your own values. Firstly you need to get the top level section ID (we have sub sections so just the section id is not enough) as a variable available to the Navbar and vbcms_navbar_link templates. The only way I have found to get this is to take the first item in the breadcrumb array. The plugin to do this is: Hook: vbcms_content_populate_start Code:
global $bci; $bci = $this->content->getBreadcrumbInfo(); vB_Template::preRegister('navbar',array('top_parent' => $bci[0]['nodeid'])); vB_Template::preRegister('vbcms_navbar_link',array('top_parent' => $bci[0]['nodeid'])); location: process_templates_complete Code:
global $bci; $tabselected = ''; $tablinks = ''; if ($bci[0]['nodeid'] == YOUR SECTION ID) { $vbulletin->options['selectednavtab']='UNIQUENAME'; $tabselected = ' class="selected"'; } $template_hook['navtab_end'] .= '<li'.$tabselected.'><a class="navtab" href="LINK TO YOUR SECTION">YOUR SECTION</a></li>' ; Code:
<vb:if condition="$top_parent != YOUR SECTION ID"> <li class="selected"> <vb:else /> <li> </vb:if> The screenshot shows the Reviews section of my site, with the various subsections appearing in the submenu area. This tab remains highlighted throughout the Reviews section, subsections and articles. Download No files for download. Screenshots |
Similar Mods
Mini Mods CMS - Sections menu navbar as pop-up | vBulletin 4.x Template Modifications |