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

  #16  
Old 07 Aug 2011, 18:52
hqarrse hqarrse is offline
 
Join Date: Mar 2010
Hi, yes you need the section ID number, and yes you will see your sub-sections. See my screenshot.
__________________
using VB 4.2.1 on the Army Rumour Service, CentOS 6. VBSEO 3.6.0
Reply With Quote
  #17  
Old 12 Aug 2011, 21:03
archet1337's Avatar
archet1337 archet1337 is offline
 
Join Date: Sep 2009
Real name: Olav
This is very nice. Any chance of getting the mod as a XML product?
__________________
Administrator @ RadioCtrl Forums - Your online R/C community.
Reply With Quote
  #18  
Old 15 Aug 2011, 08:36
hqarrse hqarrse is offline
 
Join Date: Mar 2010
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.
__________________
using VB 4.2.1 on the Army Rumour Service, CentOS 6. VBSEO 3.6.0
Reply With Quote
  #19  
Old 15 Sep 2011, 19:25
lild100 lild100 is offline
 
Join Date: Oct 2010
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
Reply With Quote
  #20  
Old 15 Sep 2011, 19:47
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
Originally Posted by lild100 View Post
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
Good luck!
Reply With Quote
  #21  
Old 15 Sep 2011, 20:20
lild100 lild100 is offline
 
Join Date: Oct 2010
Originally Posted by Boofo View Post
Good luck!
Did you get my email?
Reply With Quote
  #22  
Old 03 Oct 2011, 23:55
Ramjet79 Ramjet79 is offline
 
Join Date: Oct 2008
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.
Reply With Quote
  #23  
Old 04 Oct 2011, 05:10
hqarrse hqarrse is offline
 
Join Date: Mar 2010
Mine is 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
  #24  
Old 28 May 2012, 12:17
hqarrse hqarrse is offline
 
Join Date: Mar 2010
This hack is obsolete from V 4.2 and using this mod to extend the navigation manager:

http://www.vbulletin.org/forum/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!
__________________
using VB 4.2.1 on the Army Rumour Service, CentOS 6. VBSEO 3.6.0
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 03:26.

Layout Options | Width: Wide Color: