View Full Version : Adding a link to the navigation bar
Steve Hoffmeyer
06-24-2010, 03:37 PM
I just upgraded to vB4 and lost the custom navigation bar (and all my custom colors and styles) that I had painfully modified in my previous vB3 version.
Right now I'm looking to add ONE SIMPLE LINK to the default navigation bar (the bar that shows "New Posts Private Messages FAQ etc etc") before the "New Posts" link that says "Home" and links to the home page on my site.
Unfortunately I'm not a vBulletin programmer and I'm a total newbie when it comes to this type of customization/modification, so please give me very detailed instructions.
PLEASE don't refer me to the Articles forum, or tell me that there are a number of good threads already out there. I've already done a number of searches and found them all VERY confusing and not detailed or specific enough for my simple problem.
Thanks in advance!!!
Charlie98902
06-24-2010, 03:50 PM
Here you go - https://vborg.vbsupport.ru/showthread.php?t=228492
Steve Hoffmeyer
06-24-2010, 04:01 PM
Hi Charlie98902,
Thanks for you help, but I've already looked at that thread and could not figure out how to adapt it to my needs.
Sorry, but as I said I'm NOT a programmer and I dont know what "sample.php?" means.
What I need is detailed instructions on how to insert the word "Home" on the navigation bar and have it linked to "http:\\www.MySite.com"
Thanks,
Steve
Charlie98902
06-24-2010, 04:10 PM
<li><a href="http:\\www.MySite.com{vb:raw session.sessionurl}">Home</a></li>
There is the code but to place it you'll want to read how to put it in the right place, this isn't hard as I use it too. Of course replace the mysite.com part to the right URL. Then copy and paste.
Steve Hoffmeyer
06-24-2010, 04:27 PM
Once again, thanks Charlie, but I need to have detailed instructions on EXACTLY where the right place to put it is, and EXACTLY how to put it there.
Thanks,
Steve
Charlie98902
06-24-2010, 04:30 PM
Find in the navbar template:
{vb:raw template_hook.navbar_start}
<vb:if condition="$show['searchbuttons']">
Add below:
<li><a href="http:\\www.MySite.com{vb:raw session.sessionurl}">Home</a</li>
Don't forget to replace yoursite.com part. This is the easiest way to do it and the only. There is no plugin to do this for you.
noppid
06-24-2010, 04:56 PM
To avoid having the edit the template you can do this too. Both are only going to appear when the forum tab is active.
Populate $template_hook['navbar_start'] using hook process_templates_complete.
Create a new plugin on hook process_templates_complete
Use this php code. Edit the link as necessary.
$template_hook['navbar_start'] = '<li><a href="' . $vbulletin->options['bburl'].'/index.php?' . $vbulletin->session->vars['sessionurl'] . '">Home</a></li>';
Charlie98902
06-24-2010, 05:09 PM
Yep works well too. Can you change <li><a href="' . $vbulletin->options['bburl'].'/index.php? and add your personal url there instead too? As I use the mod I provided here but for another purpose.
Steve Hoffmeyer
06-24-2010, 05:11 PM
Hi Charlie,
That worked, but there's two problems:
1) The words "New Posts" are highlighted
2) When I move the cursor over the words "New Posts" both "Home" and "New Posts get underligned.
noppid
06-24-2010, 05:14 PM
Yep works well too. Can you change <li><a href="' . $vbulletin->options['bburl'].'/index.php? and add your personal url there instead too? As I use the mod I provided here but for another purpose.
Sure, you can make it anything you want.
$template_hook['navbar_start'] = '<li><a href="http://www.cpurigs.com/">computer help forum</a></li>';
For instance.
Steve Hoffmeyer
06-24-2010, 06:13 PM
Charlie: Thank you so much for that line of code!!!
With a little playing around, I was able to put it in the header underneath the logo and it works great there.
I REALLY appreciate your assistance.
Sincerely,
Steve
Charlie98902
06-24-2010, 07:54 PM
Thanks noppid. You're welcome steve, glad I was able to help some.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.