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 |
#12
|
||||
|
||||
You could easily make this in to a product for the plugins with the readme text file attached that explains the template edits.
|
#13
|
||||
|
||||
Thanks for your help! Got it working perfectly! -Installed
|
#14
|
|||
|
|||
Too strapped for time at the moment to take this on, but I'll do that when I have a moment. You would hope that sooner or later this functionality would come as standard in VB as it seems such a basic, normal thing to want to do.
|
#15
|
|||
|
|||
Thanks so much hqarrse !!
I've been trying to figure out how to do this for ages, and that solves the problem completely! This woud make a fantastic and surely very popular mod - I'd vote it as MOTM definitely. Yes, it is a bit clunky - but easy to do and solves a really important requirement simply and effectively. Very cool. Thanks again. |
#16
|
|||
|
|||
quick question so I don't screw this up.
Quote:
Also, I have sub-Sections under my main Sections. (not categories) If I do one of the main Sections, will the sub-sections display automatically just underneath ? for example : I have PS3 as a main section... and PS3 previews as the sub-section just underneath it. thx much in advance |
#17
|
|||
|
|||
Hi, yes you need the section ID number, and yes you will see your sub-sections. See my screenshot.
|
#18
|
||||
|
||||
This is very nice. Any chance of getting the mod as a XML product?
|
#19
|
|||
|
|||
Not from me in the near future, sorry. I just don't have the time to take it on. Also you would hope that VB will enable you to do this at some point soon, so this will hopefully become an obsolete hack.
|
#20
|
|||
|
|||
Hey looks great!
To explain what I need Ill use your screen shot as an example. If you see the nav tab 'games reviews'... If you was to put a article in there.... would the article also be displayed in the book reviews... if book reviews was called home tab. So the home tab collects all the latest articles in each selected nav tab.. If this mod doesn't do you know how this can be done? Thanks Dan |
#21
|
||||
|
||||
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|