![]() |
Displaying text color in postbit?
Playing around with custom profile fields, installing the ability for users to choose their gender. It works, but I think I want a postbit template conditional for making it display blue if they chose Male, and pink if they chose female.
Right now it displays like this: https://vborg.vbsupport.ru/external/2014/05/22.jpg Here's the bit from the postbit template, where we're calling this up: Code:
<vb:if condition="$post['field12']"><dt>Gender</dt> <dd>{vb:raw post.field12}</dd></vb:if> |
I guess you want something like:
Code:
<vb:if condition="$post['field12']"><dt>Gender</dt> <dd style="color:<vb:if condition="$post['field12'] == 'Male'">blue<vb:else />pink</vb:if>" >{vb:raw post.field12}</dd></vb:if> |
That sure looks like it might work... I will have it tried and let you know.
Thanks Kevin! |
"Invalid tag nesting" error.
|
Yeah, there were a couple of problems with that. I shouldn't even try to post things without testing them first, I don't have a very good record. Anyway, I tried it and posted the fixed code above.
|
U Da Man, thank you again!
|
We made the color "HotPink" to get it to stand out more. Nicely done Kevin and again, thank you for the help.
|
Probably the "right" way to do it would be to change it to set a class based on the gender, then put CSS in additional.css to set the colors (and/or font, size, etc). Also that way you could have different colors per style if you wanted. But if it's doing what you want the way it is, I'd say that's fine.
|
Quote:
This works for what they want, job well done. |
All times are GMT. The time now is 04:06 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|