PDA

View Full Version : Change table color


Triky
11-15-2007, 12:43 PM
Hi, I've setted a new profile field which ask for your gender. Now I would like to change a table color (in my postbit_legacy) depending by this choice.

I've tried to use this code:

<if condition="$userinfo['field20'] == '2'">class="tgender_female"<else /> class="thead"</if>

And in my additional CSS I've added this:

.tgender_female {
background: #FFFFFF url(style/gradients/gradient_tgender_female.gif) repeat-x top left;
bgcolor: red;
font-color: #FFFFFF;
font-style: bold;
font-size: 10pt,
font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif;
}



In my profile field I've put a Single-Selection Menu with:

Male
Female

Set Default: None.

It doesn't work. Is there something wrong? Can you help me?

Gray Matter
11-15-2007, 07:52 PM
There are two things wrong with your conditional.

1) Since you're using it inside a post, you need $post instead of $userinfo.
2) You need to use the title of the option for the menu.

So your code should look like this:

<if condition="$post['field20'] == 'Female'">class="tgender_female"<else /> class="thead"</if>

Triky
11-16-2007, 08:39 AM
Thank you, Gray Matter! :)