[HOW TO - vB4] Add Icons to the Navigation Bar Tabs
Hi there, everyone! :)
Prior to the vBulletin 4.0 upgrade, I had these neat little icons in the navigation bar of my v 3.8 forum's theme. Since I upgraded the forums, I wanted to put these icons back once again. However, with the rewrite of the whole code, I was at a complete loss as to where to make these changes. After a lot of searching and hit and trial, however, I did manage to come up with something that suited my needs. So I thought I'd write an article myself, with the hope that it would help others trying to do something similar. :) These template modifications allow you to add icons to the tabs in the Navigation Bar, right below the logo, as shown in the image below: I'll stick with the default Navigation Bar tabs, i.e. Home, Forum, Blogs and What's New. Although you may use images of any size, but since I did not want to meddle too much with the default design / layout, I resized all the images to 24px ? 24px. Note: I have colour coded all code edits / additions in red to make it easier to see what has been added. ------------------------------ "Home" Tab: (2 modifications needed in only 1 template) In your Admin Control Panel (ACP), go to: ACP > Styles & Templates > Style Manager > Double arrows on the right of the style you want to edit (Expand Templates) > vBulletin CMS Templates > vbcms_navbar_link Here, look for the following code: Code:
<vb:if condition="$vboptions['selectednavtab'] == 'vbcms'"> Code:
<vb:if condition="$vboptions['selectednavtab'] == 'vbcms'"> Code:
<vb:else /> Code:
<vb:else /> ------------------------------ "Forum" Tab: (3 modifications needed in only 1 template) In your Admin Control Panel (ACP), go to: ACP > Styles & Templates > Style Manager > Double arrows on the right of the style you want to edit (Expand Templates) > Navigation / Breadcrumb Templates > navbar Here, look for the following code: Code:
<vb:if condition="!$vboptions['selectednavtab'] AND THIS_SCRIPT != 'search'"> Code:
<vb:if condition="!$vboptions['selectednavtab'] AND THIS_SCRIPT != 'search'"> Code:
<vb:elseif condition="$vboptions['selectednavtab']=='usercp'" /> Code:
<vb:elseif condition="$vboptions['selectednavtab']=='usercp'" /> Code:
<vb:else /> Code:
<vb:else /> ------------------------------ "Blogs" Tab: (2 modifications needed in only 1 template) In your Admin Control Panel (ACP), go to: ACP > Styles & Templates > Style Manager > Double arrows on the right of the style you want to edit (Expand Templates) > Blog Templates > blog_navbar_link Here, look for the following code: Code:
<vb:if condition="$vboptions['selectednavtab'] == 'vbblog'"> Code:
<vb:if condition="$vboptions['selectednavtab'] == 'vbblog'"> Code:
<vb:else /> Code:
<vb:else /> ------------------------------ "What's New" Tab: (4 modifications needed in only 1 template) In your Admin Control Panel (ACP), go to: ACP > Styles & Templates > Style Manager > Double arrows on the right of the style you want to edit (Expand Templates) > Navigation / Breadcrumb Templates > navbar Here, look for the following code: Code:
<vb:if condition="$show['member']"> Code:
<vb:if condition="$show['member']"> Code:
<vb:else /> Code:
<vb:else /> Code:
<vb:elseif condition="$show['member']" /> Code:
<vb:elseif condition="$show['member']" /> Code:
<vb:else /> Code:
<vb:else /> |
Nice tip, however the img tag misses the required alt attribute :)
This code: HTML Code:
<img src="path_of_image" border="0" align="top" /> Should be: HTML Code:
<img src="path_of_image" border="0" align="top" alt="" /> |
Hello,
Are you sharing the images too, or just the code? Thanks for taking the time to document this! :) |
Quote:
--------------- Added [DATE]1270357680[/DATE] at [TIME]1270357680[/TIME] --------------- Quote:
I didn't add the images, thinking that everyone has his own liking and preference. There are plenty of sites where you can download free icons / images. Just google around a bit. If you're interested in the ones that I have, you can PM me. :) |
Hi
on <img src="path_of_image" border="0" align="top" alt="" /> , where should i put the name of a image ? between alt=" here ", or src="menues/image.jpg."? Wich format should it be? JPG GIF or ??? |
The name and extension of the image should replace path_of_image in the above code. e.g.
Code:
img src="http://forum.com/image.jpg" border........ |
Quote:
It works. Thank you. |
You're welcome. :)
|
thanks 4 good & nice work
|
How can i use it with this mod: https://vborg.vbsupport.ru/showthread.php?t=233629 ?
|
All times are GMT. The time now is 01:52 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|