This topic is locked

changingfield colour

1/4/2008 11:15:44 AM
PHPRunner General questions
scuba author

I'm trying to make fields on List-Page appear in different colors dependent on the contained data. I've looked up the according line in html-mode and added the red code. Meaning, if the data in inqdet_family_1 is SMV the field-color should be displayes green. (details_green is already defined as a class in style). However, I can't get this to work, what is missing/wrong?!?
<TD class=borderbody vAlign=middle align=middle {if $data.1inqdet_family_1_value=="SMV"}class=details_green{/if}>
Thanks for any hints!!

J
Jane 1/9/2008

Hi,
I recommend you to use Custom format on the "View as" settings dialog on the Visual Editor tab.

Here is a sample code:

if ($value == "SMV")

$value = "<span class=details_green>".$value."</span>";

S
scottw 1/14/2008

Hi I'm trying to do the same thing as Scuba and was just wondering if you could change the color of the entire row? I tried to change the background of the row in visual editor, in a similar method to Scuba, but I cannot make it work consistently.
Thanks for your help!

J
Jane 1/14/2008

Hi,
to change row color use List page: After record processed event on the Events tab.

Here is a sample:

if($data["FieldName"]=="admin")

{

$row["rowstyle"]="style=\"background:red\"";

}

S
scottw 1/14/2008

Excellent, Thanks Jane!