![]() |
Navbar Tabs for CMS Sections
1 Attachment(s)
*********** 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; location: process_templates_complete Code:
global $bci; Code:
<vb:if condition="$top_parent != YOUR SECTION ID"> 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. |
Any Demo or screenshot?
|
Yes please, screenshot as I think this may be what I have been looking for.
|
please post the screen-shot ..................
|
Any chance of a screen shot?
|
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. |
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? |
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. |
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?
|
Hi, I did it like this:
Code:
<vb:if condition="$vboptions['selectednavtab'] == 'vbcms'"> |
You could easily make this in to a product for the plugins with the readme text file attached that explains the template edits.
|
Thanks for your help! Got it working perfectly! -Installed :D
|
Quote:
|
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. :cool: Thanks again. |
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 |
Hi, yes you need the section ID number, and yes you will see your sub-sections. See my screenshot.
|
This is very nice. Any chance of getting the mod as a XML product?
|
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.
|
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 |
Quote:
|
Quote:
|
Hello. I am having a little trouble. I've got the plugins created, and can get a new tab to show up and to be clickable to it's proper destination.
However, I am having trouble with the highlighting, and the sub-sections showing up. Right now, The HOME tab stays highlighted, and the default sections are displayed, rather than the sub-sections for the selected cms section. I suspect it is a problem with my implementation of the code into the vbcms_navbar_link template. I guess I am doing it wrong. Would someone mind pasting a working version of their "vbcms_navbar_link" template that I can reference to see why the tab is not being selected properly? Thanks very much for anyone's help. |
Mine is this:
Code:
<vb:if condition="$vboptions['selectednavtab'] == 'vbcms'"> |
This hack is obsolete from V 4.2 and using this mod to extend the navigation manager:
https://vborg.vbsupport.ru/showthread.php?t=283123 To make sub-sections highlight their parent section, just multiple select the sub-sections and the parent section in the 'Sections' listbox when adding a new tab in the admin panel. The code mods in my hack can be safely removed. The template mod in vbcms_navbar_link should be removed. Thanks to the VB team and Andreas for a flexible navigation system and the extension. It is a real pleasure to see the end of my hack! |
All times are GMT. The time now is 05:51 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|