Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Navbar Tabs for CMS Sections Details »»
Navbar Tabs for CMS Sections
Version: 1.00, by hqarrse hqarrse is offline
Developer Last Online: Dec 2014 Show Printable Version Email this Page

Category: Mini Mods - Version: 4.1.2 Rating:
Released: 03-06-2011 Last Update: Never Installs: 10
Uses Plugins Template Edits
 
No support by the author.

*********** 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']));
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
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>' ;
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:
Code:
<vb:if condition="$top_parent != YOUR SECTION ID">
<li class="selected">
<vb:else />
<li>
</vb:if>
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.

Screenshots

File Type: png cms_section.png (163.5 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 03-08-2011, 11:28 PM
tekmiester tekmiester is offline
 
Join Date: Mar 2008
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any Demo or screenshot?
Reply With Quote
  #3  
Old 03-08-2011, 11:50 PM
sticky sticky is offline
 
Join Date: Sep 2003
Posts: 934
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes please, screenshot as I think this may be what I have been looking for.
Reply With Quote
  #4  
Old 03-09-2011, 03:04 AM
fluidswork's Avatar
fluidswork fluidswork is offline
 
Join Date: Apr 2010
Location: India
Posts: 143
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

please post the screen-shot ..................
Reply With Quote
  #5  
Old 03-09-2011, 03:35 AM
New Joe's Avatar
New Joe New Joe is offline
 
Join Date: May 2009
Posts: 1,128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any chance of a screen shot?
Reply With Quote
  #6  
Old 03-09-2011, 06:30 AM
hqarrse hqarrse is offline
 
Join Date: Mar 2010
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 03-09-2011, 08:58 AM
sticky sticky is offline
 
Join Date: Sep 2003
Posts: 934
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 03-09-2011, 10:15 AM
hqarrse hqarrse is offline
 
Join Date: Mar 2010
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 05-17-2011, 06:13 AM
strudinox's Avatar
strudinox strudinox is offline
 
Join Date: Mar 2010
Location: California
Posts: 147
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #10  
Old 05-17-2011, 04:35 PM
hqarrse hqarrse is offline
 
Join Date: Mar 2010
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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


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

Forum Jump


All times are GMT. The time now is 10:42 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09510 seconds
  • Memory Usage 2,307KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete