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 |
#252
|
|||
|
|||
Using $_GET['r'] isn't working. It will still have the Home tab and the new tab highlighted with both overlapping each other for sub links.
|
#253
|
|||
|
|||
This works perfectly and is a very easy to understand tutorial on how to create a new tab. I had no problems whatsoever in implementing this.
Thank you so much |
#254
|
|||
|
|||
Ok Yonatan's suggestion didn't work on 4.0.3 PL1. It is causing Home and my tab to be highlighted with all subsections from both displaying.
|
#255
|
||||
|
||||
How did you modify the condition for the submenu for the Home tab? If you don't modify it, it will always show as long as you are in the vbcms area since that is how the condition is written.
|
#256
|
|||
|
|||
I guess the code doesn't work for anything child level including subsections. I used $_GET and put all of my sections and subsections in an array in the vbcms, but only the top level sections will show the tab as hightlighted with the proper subnavbar below. If I click on a subsection, the correct tab stays highlighted, but the subnavbar selections disappear.
This is what I am using in the vbcms PHP Code:
PHP Code:
Parse error: syntax error, unexpected '{' in /data/22/2/56/92/2056418/user/2253608/htdocs/forumsbb/includes/class_bootstrap.php(399) : eval()'d code on line 14 |
#257
|
||||
|
||||
Count your ( and ) - they don't add up, which is why you got the error.
|
#258
|
|||
|
|||
Yup that was totally it. Thanks!
|
#259
|
|||
|
|||
Hi, this thread is very long and I'm still quite new to vB but have experience in developing. Is there a tutorial somewhere that shows you how to create the new sections and how to have the navbar tabs link to them all in one?
Thanks. |
#260
|
||||
|
||||
Create Sections? Like in the CMS? There are a bunch of articles on vb.com about the CMS. And when you create a section, you may select the option to put the link in the subnavmenu. You can read the articles about this.
|
#261
|
|||
|
|||
Hi,
Thanks, the thing is when I search 'create new section' or 'create section' I do not get any returns of any interset. I have tried searching but find lots of really basic stuff but not how to create new sections, I might be confused. Basically I want to create a new tab called 'Contacts' which will link to a page with lists of names and contact details. It's straight forward how to add the tab but what about the pages of content to go along with it? I understand the code you pasted originally and conditions. In section manager I can only add sections to 'Home' I want to create a section to be linked to the new tab 'Contacts' |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|