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 |
#302
|
||||
|
||||
Quote:
|
#303
|
|||
|
|||
I'm going to sound slow here... but you've kind of lost me
I am using vBadvanced CMPS. I'm not exectly sure where I get the specific details for "THIS_SCRIPT" I've looked in the page sourece code and I can't identify anything that looks like how the page is defined? Sorry for my slow uptake on this... I doo aprreciate your help! --------------- Added [DATE]1278197941[/DATE] at [TIME]1278197941[/TIME] --------------- Bingo!! Got it!! Doh! I edited the main index page and found the "THIS_SCRIPT" and we are off and running Seriously... thanks SO much for your help!!! --------------- Added [DATE]1278199197[/DATE] at [TIME]1278199197[/TIME] --------------- Hi Lynne Just a quick query... now that i have that in place, is there any way of getting the default forum settings to appear 'under' the Nav? ie: * New Posts * Private Messages * FAQ * Calendar * Community o Groups o My Albums o Friends & Contacts o Member List * Forum Actions o Mark Forums Read o General Settings o Edit Profile * Quick Links o Subscribed Threads o Open Contacts Popup o View Forum Leaders o Who's Online Cheers --------------- Added [DATE]1278200287[/DATE] at [TIME]1278200287[/TIME] --------------- Another self answered question... I just recreate my own within your code!! Doh! All done |
#304
|
|||
|
|||
This worked great for me. Thank you!
|
#305
|
||||
|
||||
I was wondering? Is it possible for this tab to go in front of the forum tab. I'm going to call it "Home" and link it with my vbadvanced page.
If anyone can help please write back soon. |
#306
|
||||
|
||||
Quote:
Quote:
|
#307
|
||||
|
||||
Ok thank you. It worked. Must of missed that part.
|
#308
|
|||
|
|||
If someone is using this and has the problem that the Homepage is selected, i modiefied the first line of vbcms_navbar_link to
PHP Code:
Hope this works for you --------------- Added [DATE]1281531651[/DATE] at [TIME]1281531651[/TIME] --------------- Only one more question: I have new NavTabs to Content Sections (e.g. content?=60) called News. Below that i have sub-nav links to content?=61 "Sports", content?=62 "Travel",... Now all this works fine, all are displayed and you can follow the link. Only problem is: If i hit one of the subNavs, "News" loses the Highligthing (Selection) and none of the Navbar is selected. Is there a way to have News Selected when using one of its sublinks ? OK Got it myself PHP Code:
Thanks in advance |
#309
|
||||
|
||||
Hi Lynne,
First of all thanks for all the help and the great article. Is there a way to create a new tab that links to the user's profile? For example the tab would be called "My Profile" and when the user clicks on it, it would take him to his profile as seen in member.php. On my forum, my user ID is "1", so the link would be www.myforum.com/member.php?1. But how do I do that through the plugin code? That is, how do I write a condition that only lets that tab show if the user is logged in, and to customize the link to be different for each user? I know that the vb command Code:
{vb:link member, {vb:raw bbuserinfo}} Code:
<a href="member.php?{vb:link member, {vb:raw bbuserinfo}}"> Thanks! |
#310
|
||||
|
||||
No need for the member.php? in front of the variable - it contains the complete link, including the path and file.
Just try Code:
<a href="{vb:link member, {vb:raw bbuserinfo}}">{vb:rawphrase your_profile}</a> |
#311
|
||||
|
||||
Quote:
Code:
http://myforum.com/member.php?1-username Code:
http://myforum.com/{vb:link member, {vb:raw bbuserinfo}} Thanks! |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|