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 |
#102
|
|||
|
|||
Thanks, Lynne! Worked perfectly for me with no issues.
Edit: One quick question, is there a way to use a condition to show the sublinks/dropdown links to just a certain usergroup? I tried a template condition, but that didn't work. |
#103
|
||||
|
||||
I believe there are examples of how to do that on pages 2 and 4 of this thread.
|
#104
|
|||
|
|||
Sorry about that, I just read the entire thread and saw that.
Thanks again |
#105
|
|||
|
|||
I just want to add in a simple link on the nav bar so I tried this and tried just removing the navlinks section of the code. The result was that my Blogs link disappeared and that was all.
What do I need to do to make this just a link on the nav bar to an external site (the add-on has problems and I'd prefer to have everything done "properly") |
#106
|
||||
|
||||
There are mods to just add a simple link with no submenu. You are probably better off just using one of them.
|
#107
|
|||
|
|||
Hello!
Ive read through the entire thread, and managed to get it all working by the end!! Thanks Lynne, for all your detailed replies, it really helped me to get it working. Im stuck at one last thing though.......how do I get all the links in the sub menu to stay on the new tab when you click on them? I have all my links in the sub menus going to VB Pages Ive created myself. But when I click on each link, while it takes me to the new VB page Ive created, the tab and submenu returns to the Forum tab. Ive played around with it a bit, but cant figure out how to make it work with multiple pages.....? Please let me know if you need any additional info to help you understand what it is Im trying to do. |
#108
|
|||
|
|||
Is there a way to replace tabs with images?
|
#109
|
||||
|
||||
Great post Lynne! I'm not that great at hacks, but I managed to get this to work for a CMS news section. I thought others may want to know how to do this too. This is how I did it:
Copy the original vBulletin file "content.php" and save as "about.php" (or whatever filename you wish) In your new about.php file Change: Code:
define('CMS_SCRIPT', true); define('THIS_SCRIPT', 'vbcms'); Code:
// define('CMS_SCRIPT', true); define('THIS_SCRIPT', 'about_ridehub'); Upload your new .php file to forum root. Make sure the CMS section you want this new nav bar to work with is "Not Published" otherwise Google will find duplicate content. This can be done in the Section Manager in the AdminCP. Now instead of linking to (for example): http://www.yoursite.co.uk/content.php/48-About You can use: http://www.yoursite.co.uk/about.php/48-About Add these links to the menu bar, and it should all work ok. See here for an example: http://www.ridehub.co.uk/about.php/48-What-is-RideHub |
#110
|
||||
|
||||
Quote:
PHP Code:
PHP Code:
|
#111
|
|||
|
|||
Thanks for the reply Lynne.
I want the tab to stay selected, when I am on any of the pages in the submenu of the new tab. Looks like it might be easier to show you the code? Its only going to make it easier for others trying to do the same thing to understand too I have created a new tab called "Site Info'. I have also created my own VB page for it to link to. This is the code for the plug in: PHP Code:
PHP Code:
I have 4 other VB pages I created myself. They are the the ones listed in the submenu of the new tab "Site Info' See first image attached. For these 4 links in the submenu, the condition in each of their VB pages is as follows: Our Philosophy Page: PHP Code:
Sig Advertising Page: PHP Code:
PHP Code:
PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|