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 |
#502
|
||||
|
||||
Hi Lynne,
is it possible to make the dropdown menu a link? I mean that clicking the arrow next to the item would result in showing the dropdown, but clicking the actual link would take you to the page I specify? Thanks |
#503
|
||||
|
||||
Quote:
I would guess you could, but you'd need to change the <a> tags and probably include the image for the dropdown and link to it also. |
#504
|
|||
|
|||
I think I figured it out.
Had a custom hook {vb:raw template_hook.navbar_after_getnew} edit: Nvm taking that out didnt do anything. So this is the coding for my navbar tabs PHP Code:
I cant figure it out. It must be a conflicting plugin? Im not that great with VB language. Any help would be appreciated. EDIT 2: I figured it out. Well not really, but I just reverted my template and started it from scratch again. Not sure what I was missing or what, but I have the results I wanted by reverting it, and then modifying that code. Thanks |
#505
|
|||
|
|||
Hello, great description. Took me a minute to figure it out, but, I got it working and I'm a pretty big newb, so, thank you.
I was wondering if there was a way to insert the new tab in a specific spot along the menu. I have 5 tabs so far, and I want this new one I created to be 4th in line. I know you can do navtab_middle, navtab_end, but, neither of those will put it in the 4th position. Thanks for any info on how to change this. Cheers. |
#506
|
||||
|
||||
Quote:
|
#507
|
|||
|
|||
I changed it to 4, and saved, since I want in the #4 spot. But, it's still in the middle (I'm using nav_middle at the present time). Would I also have to change the execution order of the other tabs? (I don't know where to look for those since I did not create plugins for them)
|
#508
|
|||
|
|||
Quote:
PHP Code:
This should be basically the same as the original plugin code Lynne posted. I took out the code for the drop down menu. |
#509
|
|||
|
|||
Quote:
This is what I did: For each CMS Page create a plugin and the condition in the plugin would be something like this: PHP Code:
Since the articles are in the CMS, both the home tab and your new tab will be selected. To fix this, edit the plugin called "Navbar: Insert CMS Navbar Entry" Find: PHP Code:
PHP Code:
|
#510
|
|||
|
|||
This is a great article - thanks to all who contributed.
What I am trying to do is add one more level to the dropdown. So for example if I click a pulldown, when I mouseover one of the options another set of options will display. I thought I could add another <ul class="popupbody popuphover"> to this code, but that just covers the current menu up. Can someone point me in the right direction? I'm not sure if this might be outside of the scope here. Thanks |
#511
|
|||
|
|||
Hello,
I tried searches for separate, several, more than, and different so if it's been mentioned, I couldn't find it through all the pages. I'd like to make several different tabs but when I do this with different plugins, the first one is in the bold style of the menu but the second one is just plain text in the style of the sub-menu. Should I put all the new tabs into one plugin? If so how? If I keep them in separate plugins, how do I keep them all in the same style of the top menu? EDIT: I found the issue. The second time around I missed copying $tabselected = ''; so it was missing from the top. Works fine now. |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|