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. |
#12
|
|||
|
|||
I put a "Home" link before the UserCP link in the Navbar but though it works fine, it's the only link that keeps the line underneath the text when all the others only do it on a mouseover. How can I fix this? Thank you!
Nevermind. All I had to do was refresh my page. Working great. Thank you! |
#13
|
|||
|
|||
wow wow and just wow thanks
|
#14
|
|||
|
|||
where can I change a text size of a links in navbar?
|
#15
|
|||
|
|||
I have added new links, however the font face, size and color do not match what was already there. Any hints to help resolve this?
|
#16
|
||||
|
||||
Thank you
|
#17
|
||||
|
||||
So helpful, thank you!!
|
#18
|
|||
|
|||
In vb3.7, how would one define a navbar link to only show for specified usergroups? I'm currently using <if condition="in_array($bbuserinfo['usergroupid'], array(6))"> wrapped around the navbar link but I have additional usergroups setup for various things. I found the additional usergroups are stored in the membergroupids field. I tried changing $bbuserinfo['usergroupid'] to $bbuserinfo['membergroupids'] but it doesn't work. What am I doing wrong?
/edit Scratch this question. I found my answer. I needed to use <if condition="is_member_of($bbuserinfo, 5, 6, 7)">. I hope this helps someone. |
#19
|
|||
|
|||
Hi Folk,
Maybe I'm a bit slow, but the only page I can find within VBulletin (3.7) to change to achieve an additional link is "vbulletin-style.xml" However if I change this and upload it nothing changes on my site (yes, I do refresh, even tried closing and opening in a different browser). So, my question is, am I changing the correct file, or should I be making the changes elsewhere? The line I am adding is... <td class="vbmenu_control"><a href="http://www.ulysses.org.nz/photopost">Photo Gallery</a></td> My site is www.ulysses.org.nz/vbulletin Cheers William New Zealand |
#20
|
||||
|
||||
Yea would be nice if we new what files we should be editing.
|
#21
|
|||
|
|||
I have now figured out how to do this, via the control Panel.
Cheers William |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|