View Full Version : Changing background for each header box
globalstrata
03-31-2007, 06:10 PM
Hello,
I am trying to change the background for each header box (each box, may have a different background). I have tried to use an IF statement to read the title of the box and based on that set the background="whatever.gif" inside of a <td> tag. However, for some reason the image is not displaying. :confused: Can anyone offer some advice?
Thanks
Gladys
CyberAlien
04-01-2007, 08:03 AM
<td style="background-image: url(images/whatever.gif);">
globalstrata
04-08-2007, 08:00 PM
Yes, but since vBulletin is using a template to display these, I need to find a way to test for the header title and depending on what I find in that header, I can define the background style. For Example
<if TITLE == "Search">
<td style="MyStyle>
</if>
Unfortunately, I do not know the right code to do this test.
thanks,
Gladys
CyberAlien
04-09-2007, 05:04 AM
If you are trying to set different background depending on what forum is shown check $vbulletin->GPC['forumid'] like this:<if condition="!$vbulletin->GPC['forumid']">
default background
<else /><if condition="$vbulletin->GPC['forumid'] == 1">
background for forum 1
<else /><if condition="$vbulletin->GPC['forumid'] == 2">
background for forum 2
</if></if></if>
globalstrata
04-17-2007, 12:58 PM
Hmm.. the <if condition="$vbulletin->GPC['forumid'] == 2"> seems not to be working in my forum. It seems that the If condition is never true so it always does the else.
Also what I originally want to do is change the header color for the Welcome, Search, Control CP, Quick Reply, etc... boxes. Some of these boxes have their own template, so it would be easy to change. See attachment for more clarification.
http://forums.origanime.com/images/headers.jpg
:o Sorry I could not explain it better and Thanks for your help!
Gladys
TheMilkCarton
04-19-2007, 06:59 AM
Those two boxes are completely different tables in the search template, and you have no need for if conditionals.
You simply need to create another "tcat" class, call it "tcat2" and change the background image. Then you just need to change the style for that td to tcat2, etc.
Like so:
<td class="tcat2">
$vbphrase[errors_occured_with_search]:
</td>
<td class="tcat3">
<if condition="$show['searchthread']">$vbphrase[search_thread] - <a href="showthread.php?$session[sessionurl]t=$threadinfo[threadid]">$threadinfo[title]</a><else />$vbphrase[search_forums]</if>
</td>
the entire tcat CSS looks like this: .tcat
{
background: #162756 url(../../images/gradients/gradient_tcat3.gif) repeat-x top left;
color: #FFFFFF;
font: bold 10pt verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
padding:6px;
}
.tcat a:link, .tcat_alink
{
color: #ffffff;
text-decoration: none;
}
.tcat a:visited, .tcat_avisited
{
color: #ffffff;
text-decoration: none;
}
.tcat a:hover, .tcat a:active, .tcat_ahover
{
color: #FFFF00;
text-decoration: underline;
}
So just make a duplicate of that, change all the "tcat" to tcat2, tcat3, whatever, and then change the colors, fonts, and images to your liking. This will of course go inside the Additional CSS Definitions in your style manager.
globalstrata
04-21-2007, 04:06 PM
ok. For some reason I am not explaining myself correctly. I am using CMPS. I want to change the header for each of the boxes that I show. So this is what CMPS shows
LEFT COLUMN MIDDLE COLUMN RIGHT COLUMN
BOX 1 BOX 2 BOX 3
BOX 4 BOX 5
BOX 6
BOX 7
For Box 1, I want the background header to be Red
For Box 2, I want the background header to be blue
For Box 3, I want the background header to be Green
For Box 4, I want the background header to be Orange
For Box 5, I want the background header to be Blue
For Box 6, I want the background header to be purple
For box 7, I want the background header to be black
Because the changes to some of these boxes are controlled by a single template, the only way I can see doing this is comparing the text that will be input for each header so I do something like:
If Box Title == Search
header -> Red
If Box Title == Login
header --> green
....
So ... What I need to know is what is the variable that I need to use in order to test for the Box Title so I can do the proper test to display the appropiate background.
Hope this explains it better,
Gladys
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.