The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
[HOW TO - vB4] Create a New Tab in the navbar
Here's a pretty simple method for creating a new tab in the navbar, along with a submenu to go along with it. All you need is a unique condition for when your tab will be shown. What you will be making is a plugin to create the Nav Link along with a submenu which Link 1, Link 2, Link 3, and Drop Down which then drops down and has SubLink 1, SubLink 2, and SubLink 3. This is shown below. NOTE: This is for 4.0.x and 4.1.x. In 4.2.x, you should be using the Navigation Manager. This article is NOT to be used just to add another link to a submenu. It is for creating the Nav Link tab along with all the submenus. Again, if all you want is to add submenus to an existing tab, then this article is NOT for you!!! This article is also for use by users who understand the basics of conditions and can write them. The navbar is not really an easy thing to play with if you don't know what you are doing - I think even Wayne said it had issues - so don't try this if you don't understand how to write a condition. OK, with that out of the way.... Here's the basic template for making your new tab: Create a plugin (Plugins & Products) > Add New Plugin: hook location - process_templates_complete * Title - New Tab for Navbar Execution Order - 5 (* I used to have this listed as global_state_check but then noticed vb themselves use the process_templates_complete hook location, so I changed it.) PHP Code:
PHP Code:
PHP Code:
PHP Code:
ragtek also posted an article to do the same thing only using a template with the plugin - [HOW TO - vB4] Create a New Tab in the navbar (with template) Originally posted on vb.org 2009-10-27. Other related articles of possible interest: [HOW TO - vB4] Remove the vB Default Navtabs [HOW TO - vB4] Create your own vBulletin page |
#352
|
|||
|
|||
Hi Lynne
Thanks for helping us but after reading so much, my knowledge only increase by abit My forum is at http://singstocks.com/forum I just need to add a "Home" tab at nav bar: Home --> Forum --> What news This home tab is a link back to my blog at http://singstocks.com. Pls help and explain clearly as i am new at codes. Thank you Code:
<div id="navbar" class="navbar"> <ul id="navtabs" class="navtabs floatcontainer<vb:if condition="$show['member'] AND $notifications_total"> notify</vb:if>"> {vb:raw template_hook.navtab_start} <vb:if condition="!$vboptions['selectednavtab'] AND THIS_SCRIPT != 'search'"> <li class="selected"><a class="navtab" href="{vb:raw vboptions.forumhome}.php{vb:raw session.sessionurl_q}">{vb:rawphrase forum}</a> <ul class="floatcontainer"> {vb:raw template_hook.navbar_start} <vb:if condition="$show['searchbuttons']"> <vb:if condition="$show['member']"> <li><a href="search.php?{vb:raw session.sessionurl}do=getnew&contenttype=vBForum_Post">{vb:rawphrase new_posts_nav}</a></li> <vb:else /> <li><a href="search.php?{vb:raw session.sessionurl}do=getdaily&contenttype=vBForum_Post">{vb:rawphrase todays_posts}</a></li> </vb:if> </vb:if> {vb:raw template_hook.navbar_after_getnew} <vb:if condition="$show['pmmainlink']"> <li><a href="private.php{vb:raw session.sessionurl_q}" rel="nofollow">{vb:rawphrase private_messages}</a></li> </vb:if> {vb:raw template_hook.navbar_after_pm} <li><a rel="help" href="faq.php{vb:raw session.sessionurl_q}" accesskey="5">{vb:rawphrase faq}</a></li> {vb:raw template_hook.navbar_after_faq} <li><a href="calendar.php{vb:raw |
#353
|
|||
|
|||
Thank you Lynne, it's perfect
|
#354
|
||||
|
||||
How do I make a navbar tab stay highlighted with you click on it?
I would like to know as soon as possible |
#355
|
||||
|
||||
your answer is above your post
|
#356
|
||||
|
||||
Thanks for telling me. Must of been reading so many post that I finally just posted to get an answer and didn't know that it was right in front of me.
|
#357
|
|||
|
|||
Great post. simple, and works great. thanks
|
#358
|
||||
|
||||
Thanks Lynne! It's Duggy-proof! I got it up and running in less than 5 mins. You are a vB Goddess!
|
#359
|
|||
|
|||
I just installed this code exactly as it appears, and it shows up on my forums menus but the drop downs do not appear - any ideas why?
I'm running on 4.1.0 I would have preferred to go with the template version of this mod but there's nothing in the template version about creating drop downs and I need drop down on my additional menu items. |
#360
|
|||
|
|||
thanks for this tutorial, very nice
used to create a tutorial on how to embed webchat-IRC: http://thomasfischer.biz/?p=441 |
#361
|
|||
|
|||
I've added a tab called Features which works great thanks..
Question is now that I am calling custom vb pages that I'm creating from this tab how do I get the tab to be the highlighted tab? For example in my custom VB page dynodb.php Code:
define('THIS_SCRIPT', 'dynodb'); define(ncoextratab, true); Code:
<vb:if condition="$vboptions['selectednavtab'] == 'ncoextratab'"> <li style="border-top-style:solid; border-top-color:white; border-top-width:1px; border-left-style:solid; border-left-color:white; border-left-width:1px;" class="popupmenu"> <a style="text-decoration:none;" color='#ff0000'" href="javascript://" class="popupctrl" ><b>Features</b></a> <ul class="popupbody popuphover"> <li><a href="http://www.newcelica.org">Install Guides</a></li> <li><a href="http://partscatalog.newcelica.org/page.php">Parts Catalog</a></li> <li><a href="http://tracktimes.newcelica.org/index.php">Track Times</a></li> <li><a href="dynodb.php">Dyno Database</a></li> <li><a href="http://www.newcelica.org/other/technical/index.htm">Technical Information</a></li> <li><a href="http://www.newcelica.org/other/store/index.htm">NC.org Gear</a></li> </ul> </li> <vb:else /> <li style="border-top-style:solid; border-top-color:white; border-top-width:1px; border-left-style:solid; border-left-color:white; border-left-width:1px;" class="popupmenu"> <a onmouseover="this.style.color='#ff0000'" onmouseout="this.style.color='#ffffff'" href="javascript://" class="popupctrl" ><b>Features</b></a> <ul class="popupbody popuphover"> <li><a href="http://www.newcelica.org">Install Guides</a></li> <li><a href="http://partscatalog.newcelica.org/page.php">Parts Catalog</a></li> <li><a href="http://tracktimes.newcelica.org/index.php">Track Times</a></li> <li><a href="dynodb.php">Dyno Database</a></li> <li><a href="http://www.newcelica.org/other/technical/index.htm">Technical Information</a></li> <li><a href="http://www.newcelica.org/other/store/index.htm">NC.org Gear</a></li> </ul> </li> </vb:if> http://vb.newcelica.org/dynodb.php |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|