The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
How To Add Additional Links To Your Navbar
There is one thing that you never seem to have enough of with a modified vBulletin site, and that is navbar space. This article covers how to add additional links to your navbar both on your regular one, and adding another row to it to stop it getting too busy. Also included in this article is showing and hiding links for guests and members. Part One: Adding Links To Your Standard Navbar Scenario used: You have a HTML page on your site with a map to the location of a regular meeting place for people from your site. You need to add the link to this page to your navbar for easy access by your visitors. This page is located at yoursite.com/map.html To add a link to the additional page (it can be a page within vB or not even on your site) you need to use the following code: Code:
<td class="vbmenu_control"><a href="http://yoursite.com/map.html" target="_blank">Map</a></td> Code:
<td class="vbmenu_control"> Code:
<a href="http://yoursite.com/map.html" Code:
target="_blank" Code:
Map</a></td> The best place to add the code for your additional link, is either immediately before or after the link to the calendar Code:
<td class="vbmenu_control"><a href="calendar.php$session[sessionurl_q]">$vbphrase[calendar]</a></td> If you have a number of modifications installed that have required additional links on your navbar, it quickly becomes very full. Now you can install a modification to add another navbar to your site, or you can simply create another row in your existing one. When adding another row, it is important that you use a new table, otherwise your links will be forced into alignment with those on the top row, leaving an unsightly gap at the right side of the row. In your navbar template, locate the following code: Code:
<if condition="$show['member']"> <td class="vbmenu_control"><a href="login.php?$session[sessionurl]do=logout&logouthash=$bbuserinfo[logouthash]" onclick="return log_out()">$vbphrase[log_out]</a></td> </if> </tr> </table> Code:
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center" style="border-top-width:0px"> <tr align="center"> <td class="vbmenu_control"><a href="index.php">Sample Link</a></td> </tr> </table> First remove the Sample link from the code above by deleting that line from the template. Then using the method from Part One, add your new links to this row. You can move links from the top row by cutting and pasting them into the new row. Part Three: Showing Links To Guests Or Members Only There are some things that you really don't want guests to know about. After all, what is the point of showing a guest the link to the usercp when all they will get is a no permissions message? So what can you do about it? Wrapping the whole code for the link in an if conditional will only show the link to those who meet the criteria set. To show a link to members only use: Code:
<if condition="$show[member]">[high]link code from part one[/high]</if> The same works for guests: Code:
<if condition="$show[guest]">[high]link code from part one[/high]</if> I hope that this helps with managing links on your navbar better. Feel free to ask any questions related to this. |
#22
|
||||
|
||||
The code below will give you a new navbar above and it will also look just like the other (correct borders and so on..)
This is for vB 3.7.1, change the links to what you would like them to be. Code:
<!-- top nav links bar --> <div class="tborder" style="padding:$stylevar[cellspacing]px; border-top-width:1px; border-bottom-width:0px"> <table cellpadding="0" cellspacing="0" border="0" width="100%" align="center"> <tr align="center"> <td class="vbmenu_control"><a href="index.php?$session[sessionurl]">Home</a></td> <td class="vbmenu_control"><a href="online.php?$session[sessionurl]">$vbphrase[whos_online]</a></td> <td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getdaily">$vbphrase[todays_posts]</a></td> <td class="vbmenu_control"><a href="forumdisplay.php?$session[sessionurl]do=markread">$vbphrase[mark_forums_read]</a></td> <if condition="$show['member']"> <td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=process&showposts=0&starteronly=1&exactname=1&searchuser=$bbuserinfo[username]">My Threads</a> / <a href="search.php?$session[sessionurl]do=process&showposts=0&exactname=1&searchuser=$bbuserinfo[username]">Replies</a></td> <td class="vbmenu_control"><a href="#" onclick="window.open('misc.php?$session[sessionurl]do=buddylist&focus=1','buddylist','statusbar=no,menubar=no,toolbar=no,scrollbars =yes,resizable=yes,width=250,height=300'); return false;">$vbphrase[open_buddy_list]</a></td> <td class="vbmenu_control"><a href="member.php?$session[sessionurl]u=$bbuserinfo[userid]">$vbphrase[my_profile]</a></td> </if> <if condition="$bbuserinfo[usergroupid] == 6"> <td class="vbmenu_control"><a href="$admincpdir/index.php$session[sessionurl_q]">AdminCP</a></td> </if> </tr> </table> </div> <!-- / top nav links bar --> Demo: www.mycncuk.com |
#23
|
|||
|
|||
I have 3 calendars on my forum. What do I do to remove the current Calendar link on the navbar and change it to a Calendars link with 3 drop down boxes.
I tried the mod here, and was able to add one drop down box, but not more, and the link didnt work. It looked good but didnt connect to anything. Any help here? |
#24
|
|||
|
|||
thanks
|
#25
|
|||
|
|||
This worked great for me....but I have a problem....with the new link in the navbar it opens a new window. How do I stop this?
|
#26
|
||||
|
||||
Hi,
which is the template that we're talking here? where can we find it? |
#27
|
|||
|
|||
Thanks so much.
|
#28
|
||||
|
||||
I can't seen to get to the HTML page for my site to try and make the changes. I keep getting the error page.
My Site: www.ofagewizards.com/home For the HTML map: www.ofagewizards.com/map.html Is there something I'm doing wrong? |
#29
|
|||
|
|||
Where do I add this mod? Do I it In the CP? Where do I find it?
|
#30
|
|||
|
|||
Thank you so much for this information.
You saved me so much time and pain. --------------- Added [DATE]1225784458[/DATE] at [TIME]1225784458[/TIME] --------------- Is there some way to space the links evenly along the navbar? Right now the new links I added seem to take up more room than the standard vBulletin links. I used the exact same code/tag format given at the top of this thread. Thanks very much! |
#31
|
|||
|
|||
where exactly is this at?place is either immediately before or after the calendar link.
i added a second row but cant seem to add just a link --------------- Added [DATE]1225827503[/DATE] at [TIME]1225827503[/TIME] --------------- Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|