Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Navbar Tabs for CMS Sections Details »
Navbar Tabs for CMS Sections
Mod Version: 1.00, by hqarrse (Member) hqarrse is offline
Developer Last Online: Dec 2014 I like it Show Printable Version Email this Page

vB Version: 4.1.2 Rating: (1 vote - 5.00 average) Installs: 10
Released: 07 Mar 2011 Last Update: Never Downloads: 0
Not Supported Uses Plugins Template Edits  

*********** 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

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Now we need a new tab for our section. Creating a tab is described in various places on vb.org, but in a nutshell the plugin is:

location: process_templates_complete

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

now you just need to disable the highlighting on the home tab for your section of the CMS. This is done by editing the template vbcms_navbar_link, and making the <li class="selected"> near the top as conditional. Change the existing <li class="selected"> to:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

You can of course do multiple sections in this way by editing that condition to include all the top level section ids (!= a AND != b AND !=c...) where you don't want the 'Home' tab selected.

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 Now

Only licensed members can download files, Click Here for more information.

Screenshots

Click image for larger version

Name:	cms_section.png
Views:	1242
Size:	163.5 KB
ID:	127288  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
Mini Mods CMS - Sections menu navbar as pop-up napy8gen vBulletin 4.x Template Modifications 8 24 Jun 2013 18:41

Comments
  #2  
Old 09 Mar 2011, 00:28
tekmiester tekmiester is offline
 
Join Date: Mar 2008
Any Demo or screenshot?
Reply With Quote
  #3  
Old 09 Mar 2011, 00:50
sticky sticky is offline
 
Join Date: Sep 2003
Yes please, screenshot as I think this may be what I have been looking for.
Reply With Quote
  #4  
Old 09 Mar 2011, 04:04
fluidswork's Avatar
fluidswork fluidswork is offline
 
Join Date: Apr 2010
Real name: Arnab Bhadra
please post the screen-shot ..................
Reply With Quote
  #5  
Old 09 Mar 2011, 04:35
New Joe's Avatar
New Joe New Joe is offline
 
Join Date: May 2009
Any chance of a screen shot?
Reply With Quote
  #6  
Old 09 Mar 2011, 07:30
hqarrse hqarrse is offline
 
Join Date: Mar 2010
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.
__________________
using VB 4.2.1 on the Army Rumour Service, CentOS 6. VBSEO 3.6.0

Last edited by hqarrse; 09 Mar 2011 at 07:40.
Reply With Quote
  #7  
Old 09 Mar 2011, 09:58
sticky sticky is offline
 
Join Date: Sep 2003
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?
Reply With Quote
  #8  
Old 09 Mar 2011, 11:15
hqarrse hqarrse is offline
 
Join Date: Mar 2010
You can do most things just by adding tabs as described by Lynne here: http://www.vbulletin.org/forum/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.
__________________
using VB 4.2.1 on the Army Rumour Service, CentOS 6. VBSEO 3.6.0
Reply With Quote
  #9  
Old 17 May 2011, 07:13
strudinox's Avatar
strudinox strudinox is offline
 
Join Date: Mar 2010
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?
__________________
GND-Tech - Technology - Gaming - Community
Reply With Quote
  #10  
Old 17 May 2011, 17:35
hqarrse hqarrse is offline
 
Join Date: Mar 2010
Hi, I did it like this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
using VB 4.2.1 on the Army Rumour Service, CentOS 6. VBSEO 3.6.0
Reply With Quote
  #11  
Old 17 May 2011, 17:41
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
You could easily make this in to a product for the plugins with the readme text file attached that explains the template edits.
Reply With Quote
  #12  
Old 18 May 2011, 03:50
strudinox's Avatar
strudinox strudinox is offline
 
Join Date: Mar 2010
Thanks for your help! Got it working perfectly! -Installed
__________________
GND-Tech - Technology - Gaming - Community
Reply With Quote
  #13  
Old 18 May 2011, 11:10
hqarrse hqarrse is offline
 
Join Date: Mar 2010
Originally Posted by Boofo View Post
You could easily make this in to a product for the plugins with the readme text file attached that explains the template edits.
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.
__________________
using VB 4.2.1 on the Army Rumour Service, CentOS 6. VBSEO 3.6.0
Reply With Quote
  #14  
Old 16 Jul 2011, 18:42
anolian anolian is offline
 
Join Date: Jun 2011
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.
Reply With Quote
  #15  
Old 07 Aug 2011, 17:50
mikeinjersey mikeinjersey is offline
 
Join Date: Feb 2006
quick question so I don't screw this up.

YOUR SECTION ID
is just looking for a number and nothing else, right ? like 15 ?

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
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 13:25.

Layout Options | Width: Wide Color: