View Full Version : [HOW TO - vB4] Create a New Tab in the navbar
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
Lynne
01-24-2012, 04:25 PM
Im not sure why, but I cannot get ANY tabs to show up to the right of the what's new tab. Ive tried Mods (from vb.org) as well as this. Ive tried this code stock. I cannot get ANY tab to show up to the right of my "What's New" tab.
Currently I only have FORUMS, and WHATS NEW.
What could be the issue? Any help please?
What template_hook are you using? What execution order?
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
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.
leftanalog
01-24-2012, 04:47 PM
What template_hook are you using? What execution order?
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
{vb:raw template_hook.navtab_start}
<vb:if condition="!$vboptions['selectednavtab'] AND THIS_SCRIPT != 'search'">
<li class="selected"><a class="navtab" href="http://leftanalog.net/forums">{vb:rawphrase forum}</a>
<ul class="floatcontainer">
{vb:raw template_hook.navbar_start}
<vb:if condition="$show['searchbuttons']">
<vb:if condition="$show['member']">
<vb:else />
<li><a href="search.php?{vb:raw session.sessionurl}do=getdaily&contenttype=vBForum _Post">{vb:rawphrase todays_posts}</a></li>
</vb:if>
</vb:if>
Then it goes into the lower bar under the tabs and starts with those. Is there anything in there, that would prevent a tab to display to the right of What's New".
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
JErix
01-24-2012, 08:46 PM
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.
Lynne
01-24-2012, 09:29 PM
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.
You may need to also change the execution order to get it into the exact right spot.
JErix
01-24-2012, 11:25 PM
You may need to also change the execution order to get it into the exact right spot.
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? :o (I don't know where to look for those since I did not create plugins for them)
malinghi
01-26-2012, 02:24 AM
can you provide the full plugin code, either here or via PM and i'll take a proper look
$tabselected = '';
$tablinks = '';
if (THIS_SCRIPT == 'guides_script')
{
$vbulletin->options['selectednavtab']='Guides';
$tabselected = ' class="selected"';
}
$links = array("link 1", "link 2", "link 3");
$max = sizeof($links);
$rand = rand(0, $max);
$template_hook['navtab_end'] .= ('<li'.$tabselected.'><a class="navtab" href=$links[$rand]>Nav Link</a>'.$tablinks.</li>');
This should be basically the same as the original plugin code Lynne posted. I took out the code for the drop down menu.
Travis-Mc
01-26-2012, 06:59 AM
No. I do. I'm using a eloquent red skin. I want to try with the deafault one too. No I didn't modifi the plugin.
--------------- Added 1323682221 at 1323682221 ---------------
tried. REQUEST_URI is empty. Any idea?
--------------- Added 1323688580 at 1323688580 ---------------
I have finally found a way that works, with this condition:
if ($_SERVER['HTTP_REFERER'] == 'http://www.piacenzacalcio.net/vb/content.php?3-prossima-trasferta')
The condition is verified, but still the tab is not highlighted and submenus do not appear. here is the plugin:
$tabselected = '';
$tablinks = '';
if ($_SERVER['HTTP_REFERER'] == 'http://www.piacenzacalcio.net/vb/content.php?3-prossima-trasferta')
{ $vbulletin->options['selectednavtab']='prossimatrasferta';
$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> ';
*/echo $tablinks;
die();*/
}
$template_hook['navtab_end'] .= '<li'.$tabselected.'><a class="navtab" href="content.php?3-prossima-trasferta">Prossima trasferta</a>'.$tablinks.'</li>' ;
I have verified that $tablinks is not empty, through the echo you can see.
If I understand your problem, you're trying to get your new tabs to be "selected" after you click on them, and they are page in the CMS like content.php?XX
This is what I did:
For each CMS Page create a plugin and the condition in the plugin would be something like this:
if ($vbulletin->nodeid == XX)
Where XX is the nodeid of the page
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:
if (defined('CMS_SCRIPT') AND class_exists('vBCms_Navbar'))
Replace:
if (defined('CMS_SCRIPT') AND class_exists('vBCms_Navbar') AND !in_array($vbulletin->nodeid, array(XX, XX, XX)))
I hope that helps.
fldewey
02-13-2012, 06:33 PM
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
Akyeame Kwame
03-20-2012, 09:49 PM
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.
MacroPhotoPro
04-02-2012, 09:44 PM
Thank you for making this Mod, I got it working fine now :)
Christos Teriakis
05-23-2012, 04:04 PM
Is this compatible with vB42? Because everything that I was using related to NavBar simple does not works. No errors, but ...nothing to see there.
Thank you
Chris
Lynne
05-23-2012, 10:05 PM
The only $template_hooks in vB4.2 navbar template are navbar_start and navbar_end, so only those two will work to add a navtab. However, the code to make a tab selected has totally changed, so that code will cause issues in 4.2.0 onward. You should use the new navigation manager if you are running 4.2.0
Boofo
05-23-2012, 10:07 PM
How do you add sub-menus then that can't be added manually in the Navigation Manager?
Lynne
05-23-2012, 10:15 PM
How do you add sub-menus then that can't be added manually in the Navigation Manager?
I haven't looked into that and can't think why you wouldn't be able to add a sub-menu via the new Navigation Manager. I've added test sub-menus to my test site just fine using the new NM.
Boofo
05-23-2012, 10:39 PM
True, but these sub-menus can't be done with the Navigation Manager as I use a vb:each setting to get the content for the menu and I see no way to add the ability to do that. If they are standard links, then yes, but not all menus are built the same, I guess. ;)
Badshah93
05-24-2012, 01:13 PM
True, but these sub-menus can't be done with the Navigation Manager as I use a vb:each setting to get the content for the menu and I see no way to add the ability to do that. If they are standard links, then yes, but not all menus are built the same, I guess. ;)
read this mate
https://vborg.vbsupport.ru/showpost.php?p=2331095&postcount=25
sub-menu, sub-links all can be added with just a plugin in vb 4.2.0 (no need to create template for navlinks)
Boofo
05-24-2012, 01:31 PM
I read that and it confused me even more. LOL
TheSupportForum
06-01-2012, 12:44 PM
can instructions be added for vBulletin 4.2
with the new Navigation Manager
How do i add a link using my existing MODS to auto add to the Navigation Manager
nhawk
06-01-2012, 01:10 PM
can instructions be added for vBulletin 4.2
with the new Navigation Manager
How do i add a link using my existing MODS to auto add to the Navigation Manager
A couple of different methods are discussed here...
https://vborg.vbsupport.ru/showthread.php?t=283146
cjwinternet
07-06-2012, 08:37 PM
Look at this mess, just to add a bit of navigation.
Lynne
07-06-2012, 08:54 PM
Look at this mess, just to add a bit of navigation.
Actually, all of this is unnecessary in vB4.2 (as I state in the first post) because there is now the Navigation Manager.
firebrand media
01-18-2013, 08:14 PM
I'm using the plugin method to add tabs to specific forums. I would like to apply the SELECTED class when displaying that class, but I'm not sure what criteria to use. Isn't THIS_SCRIPT always going to forum for those pages?
We're sticking with 4.1 since we've got a lot of modifications to the navigation and we will have to rebuild for 4.2.
With any luck, we can skip 4.2 and go straight to 5 when it's stable. :)
Lynne
01-18-2013, 10:12 PM
I'm using the plugin method to add tabs to specific forums. I would like to apply the SELECTED class when displaying that class, but I'm not sure what criteria to use. Isn't THIS_SCRIPT always going to forum for those pages?
)
For forums, you can probably use $GLOBALS['forumid'] in the condition.
layyous
02-02-2013, 01:59 PM
is there a way to create a tab (that stays in the same forum) just so that it can be used for navigation purposes to links, the reason for this is because i have static pages on the same domain and i don't want to add all the links to them under the forum tab,( by creating a sub menu) instead i want the tabs to act like sub menu's
to elaborate more, i tried creating a tab, (lets call it my links). and in this tab i want a sub menu with links to pointed pages lets say a link is pointing to mydomain.com/mypage.htm
the problem i have here is when i create a tab and have it pointing to (nothing) and click on it the page gets redirected to forum tab again... i dont want this to happen i want the tab to act like a navagation menu while at the same time staying in the forum... and all the sub menus and links show up under this tab
cellarius
02-02-2013, 02:37 PM
This article is about PROFILE tabs, not navigation tabs.
Lynne
02-02-2013, 03:57 PM
is there a way to create a tab (that stays in the same forum) just so that it can be used for navigation purposes to links, the reason for this is because i have static pages on the same domain and i don't want to add all the links to them under the forum tab,( by creating a sub menu) instead i want the tabs to act like sub menu's
to elaborate more, i tried creating a tab, (lets call it my links). and in this tab i want a sub menu with links to pointed pages lets say a link is pointing to mydomain.com/mypage.htm
the problem i have here is when i create a tab and have it pointing to (nothing) and click on it the page gets redirected to forum tab again... i dont want this to happen i want the tab to act like a navagation menu while at the same time staying in the forum... and all the sub menus and links show up under this tab
I'm sure there is a way to do what you want, but this is not an article about doing it that way. You would need to play with the plugin code and modify it to get what you want.
cellarius
02-03-2013, 08:03 AM
This article is about PROFILE tabs, not navigation tabs.
OK, now I'm the idiot :) Why exactly was I absolutely sure I was in my profile tab article? :D
Sorry ;)
layyous
02-03-2013, 10:35 AM
I'm sure there is a way to do what you want, but this is not an article about doing it that way. You would need to play with the plugin code and modify it to get what you want.
Thank you
Omegatron
03-13-2013, 01:09 AM
Quick question. I know the userinfo and options variables are present and usuable in the link portion of the navigation manager and can define other variables there.
Is there a way define a dynamic variable that can be used in the title portion of the vb navigation manager.
I am assuming I will have to ditch the straight xml navigation links I do now and use this method of it being in a plugin.
Lynne
03-13-2013, 02:13 AM
Quick question. I know the userinfo and options variables are present and usuable in the link portion of the navigation manager and can define other variables there.
Is there a way define a dynamic variable that can be used in the title portion of the vb navigation manager.
I am assuming I will have to ditch the straight xml navigation links I do now and use this method of it being in a plugin.
I would guess you could? It's hard to get more specific when I don't have a more concrete example of what you want to do.
Omegatron
03-13-2013, 01:16 PM
what I meant by design was say I want to have a dynamic link title. Right now I use straight navigation links in an xml file. I can define options through plugins to plug into urls for the navigation.
What I am needing is a dynamic title.
Say for instance take the PM indicator no messages 1 message 2 messages. I am looking to do a title like that on a submenu item.
It is no big deal.
Based on what I know I am going to have to ditch the straight way of doing links and do more like this thread plugin way that way I have total control over the variables and can define a variable title on a sublink title. ;)
I do have one question though on your way of doing things. How to you set show permissions doing a navbar your way.
Lynne
03-13-2013, 06:14 PM
Based on what I know I am going to have to ditch the straight way of doing links and do more like this thread plugin way that way I have total control over the variables and can define a variable title on a sublink title. ;)
I do have one question though on your way of doing things. How to you set show permissions doing a navbar your way.
If you want a dynamic title, then yes, you will need to use a plugin.
As for $show permissions, just do a search on this thread because that has been covered a few times.
Can I create a Quick Link to go to a specified custom usergroup? v 4.1.3
Lynne
06-25-2013, 03:31 PM
How do you create a link to a usergroup? I don't understand exactly what you want at all. If you are talking about a link showing for only a certain usergroup, then that has been covered many times in this thread.
seventhaxis
01-24-2014, 12:25 AM
See posts below.
ozzy47
01-24-2014, 12:27 AM
What version of vB are you running?
seventhaxis
01-24-2014, 01:52 AM
Ah sorry, 4.1.10
seventhaxis
01-25-2014, 01:14 PM
In order to make more than one tab, I'm assuming I have to make separate plugins. If so, how do I go about ordering them if they're all placed at the end? Is it just automatically ordered alphabetically according to the slot they're placed in (i.e. _start, _middle, _end)?
Also, how do I define the subnav I want showing when I navigate to a separate page? For example, I have created the 'Members' tab and one of the subnav items is 'Competitive Rosters - Dota 2' -- if I click that page, the subnav links change to show the Forum subnav (e.g. New Posts, Calendar, Community, Private Messages). See www.parallaxgaming.com.
Running 4.1.10 -- not looking to update to newer version.
Lynne
01-25-2014, 07:02 PM
You can add all the tabs to the same plugin and put them in the order you want.
As for making them highlight when you click on them, that is done in the plugin (the $tabselected part - unless you have modified the CSS on your site, then it may not work).
friendlymela
07-21-2015, 03:49 PM
how do i add fb group in navbar
Lynne
07-21-2015, 04:41 PM
how do i add fb group in navbar
If you are running 4.2.2, the you would use Settings > Navigation Manager to add any tabs. You would not use the plugin method in this article.
pjkcards
11-18-2015, 01:17 AM
navtab_middle isn't working for me. Nothing shows up when I change from navtab_end to navtab_middle. navtab_end works though. I want to add this link in the middle of the nav menu next to the Forum link.
What do I need to do to troubleshoot this?
Thanks.
Budget101
11-18-2015, 08:35 AM
navtab_middle isn't working for me. Nothing shows up when I change from navtab_end to navtab_middle. navtab_end works though. I want to add this link in the middle of the nav menu next to the Forum link.
What do I need to do to troubleshoot this?
Thanks.
Did you disable all mods, then test it? I have a mod that disables mine from working properly.
Do you have the same issue in the vb default style?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.