The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Navbar Tabs for CMS Sections Details »» | |||||||||||||||||||||||||||
*********** 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. Screenshots
Show Your Support
|
Comments |
#2
|
|||
|
|||
Any Demo or screenshot?
|
#3
|
|||
|
|||
Yes please, screenshot as I think this may be what I have been looking for.
|
#4
|
||||
|
||||
please post the screen-shot ..................
|
#5
|
||||
|
||||
Any chance of a screen shot?
|
#6
|
|||
|
|||
It's not a very exciting screenshot - the VB 4 menu bar at the top of a CMS section! It just adds a navbar tab that can link to a CMS section. Normally it is only possible to add links to the submenu and they would all appear under "home"
I will be able to show show this on one of my sites in a couple of days and will post a link then. I did it for a new theme and it's not live yet. |
#7
|
|||
|
|||
I have been looking for something like this.
Can those links at the tops be used to link to anything? For example forum sections, member profiles, whatever? |
#8
|
|||
|
|||
You can do most things just by adding tabs as described by Lynne here: https://vborg.vbsupport.ru/showthread.php?t=226914
The mod above is specifically for CMS sections which are not as simple as just adding a tab. Sorry if I wan't clear. |
#9
|
||||
|
||||
So far I've got this working perfectly with one tab, however, when I add multiple tabs, I can' get the syntax in the "vbcms_navbar_link" template to accept multiple tabs. I tried adding "AND" in between each one, but the result of it was Highlighting the Home link and the selected tab. What is the syntax you used on your site?
|
#10
|
|||
|
|||
Hi, I did it like this:
Code:
<vb:if condition="$vboptions['selectednavtab'] == 'vbcms'"> <vb:if condition="$top_parent != 248 AND $top_parent != 357 AND $top_parent != 251 AND $top_parent != 255"> <li class="selected"> <vb:else /> <li> </vb:if> |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|