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 |
#132
|
||||
|
||||
Quote:
PHP Code:
|
#133
|
|||
|
|||
Quote:
Thanks |
#134
|
||||
|
||||
Lynne,
Is there any way to add an extra tab using this method, while retaining the same tablinks as are used on the Forum tab? For my example, I'm trying to add a "Home" tab for vBa CMPS, but want to keep all the links you find on the Forum one. |
#135
|
||||
|
||||
You may just copy all the links for the Forum tab.
|
#136
|
|||
|
|||
I'm trying to create a forum for Traveling. I've downloaded and installed vBh that allows me to add extra tabs. These tabs only link to another site.
I want to create a Nav menu like this "Forum | Travel | Hotels | Car Rental" When the user clicks on a tab, it will open the tab in the same window but it would be about the topic the user click on. I've seen on other sites that this is possible. Just wondering how it's done. Please provide some details. I'm on vB 4.0.1, just in case you need to know the version. Thanks. |
#137
|
||||
|
||||
I can't tell you how to use the other mod - I have no idea how it works. This article will tell you how to create a navtab, such as Travel, and you link it to your forumdisplay.php page for that forum. If you want the tab highlighted at that point, then do an if condition based on the $forumid.
|
#138
|
|||
|
|||
Hi Lynne,
This might either be slightly off topic or may perhaps help others if added to your initial post. My search on changing tab order didn't return any useful results. However if whatever I've written is a commonly known solution, please disregard and delete the post All, It seems many people have asked about reordering tabs in the nav bar. As mentioned in many places there are three template hooks which allow you to place your new tab: - navtab_start - navtab_middle - navtab_end Lynne has used the navtab_end hook which is in the last line of the PHP Code: Code:
$template_hook['navtab_end'] .= '<li'.$tabselected.'><a class="navtab" href="link.php">Nav Link</a>'.$tablinks.'</li>' ;
Forum | Blogs | What's New If we use the Lynnes way of creating a tab as explained here, but use the navtab_middle hook like: Code:
$template_hook['navtab_middle'] .= '<li'.$tabselected.'><a class="navtab" href="link.php">Nav Link</a>'.$tablinks.'</li>' ;
This is the only reliable solution I have found and am using it on my own forum (img attached). I'm open to other methods as well. Cheers |
#139
|
|||
|
|||
Lynne,
Can you post the link.php code you mention in the very first post of the thread. $template_hook['navtab_end'] .= '<li'.$tabselected.'><a class="navtab" href="link.php">Nav Link</a>'.$tablinks.'</li>' ; I would like to see how link.php is written. Thanks. |
#140
|
||||
|
||||
Quote:
|
#141
|
|||
|
|||
Quote:
I understand that. I just want to see how another page is written, which variable is need to recreate the same page as forum.php but displaying a different information. I know how to code php but don't know the structure of how vbulletin assembles its code. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|