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 |
#332
|
||||
|
||||
Quote:
I've used your plugin here successfully for quite a while and love it! I'm now trying to rework my navigation to create drop-down menus on most of my TABS. I've tried Shelby's mod (referenced above) and I believe that YOURS is closer to meeting my needs, however I need some help adapting it. Basically, what I want is ALL the functionality of your plugin PLUS the ability to include drop-down menus on the TABS themselves! Problems with Shelby's Mod (for my needs):
For example, one of my TABS is for the EVENT CALENDAR: EVENT CALENDAR
Then once any of those three links above, in the tab menu are selected, I want to have the Event Calendar button highlighted (show SELECTED same as vB default behavior), and have the standard Forum submenu (tablinks) replaced with one custom submenu that says "Add New Event". So this text link will appear alone in the upper left corner of the navigation submenu (under the row of tabs). I've been playing with this all day, but can't seem to figure it out. I'm unsure whether it is NECESSARY to do this in two steps by creating the new template and plugin as suggested by Shelby. I don't mind either way, I just need help adapting one of the mods to include these features. Any help would be appreciated! Thanks! Jeff |
#333
|
||||
|
||||
You are going to have to merge the two mods together. I'd suggest doing that and then starting your own thread where you post your code and images or your result (or a link to see it). That way, we can try out your code ourselves and see what is going on and make suggestions for changes.
|
#334
|
||||
|
||||
Quote:
My concern with that is three fold:
Your thoughts? Thanks! Jeff |
#335
|
||||
|
||||
1. No you wouldn't. You are simply taking our instructions and writing your own. I'm talking about putting in your own links and all that - post exactly what your plugin code currently is.
2. Ignore them or say "I don't know". It's a help thread - you are asking for help not offering help. 3. Post it. Tell us what isn't working. Tell us what the conditions are for the tab to be highlighted. You need to verbalize that anyway so you can write your condition for it. |
#336
|
||||
|
||||
Ok, I misunderstood what you were saying.
What forum should I post the new help thread in? Modification Requests/Questions (Unpaid)? vB4 Design and Graphics Discussions? Thanks again for your assistance! Jeff |
#337
|
||||
|
||||
You could post it in here - vB4 General Discussions (or vB4 Programming Discussions)
|
#338
|
||||
|
||||
Quote:
|
#339
|
|||
|
|||
hey lynn i am not a programer and am really bad at all this...is there a way i could pay you to install it on my site?
|
#340
|
|||
|
|||
I put in the plugin code but it only creates a tab beside forum it's a link to another website
and there's no nav bar with menu. Code:
$tabselected = '';
$tablinks = '';
if (THIS_SCRIPT == 'new site')
{
$vbulletin->options['selectednavtab']='hlstat';
$tabselected = ' class="selected"';
$tablinks = ' <ul class="floatcontainer">
<li><a href="link1.php">Link 1</a></li>
<li class="popupmenu">
<a href="javascript://" class="popupctrl">Drop Down</a>
<ul class="popupbody popuphover">
<li><a href="sublink1.php">SubLink 1</a></li>
<li><a href="sublink2.php">SubLink 2</a></li>
<li><a href="sublink3.php">SubLink 3</a></li>
</ul>
</li>
<li><a href="link2.php">Link 2</a></li>
<li><a href="link3.php">Link 3</a></li>
</ul> ';
}
$template_hook['navtab_middle'] .= '<li'.$tabselected.'><a class="navtab" href="http://website.com">name here</a>'.$tablinks.'</li>' ;
Trying to make it under my home tab which has nothing under it, using vbadvanced. |
#341
|
||||
|
||||
Since you are linking to another site, you will be on another site after you click the link and therefore it can't be highlighted.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|