Change color to a value

I would like to color a field by value in the list view.
For example if I have a text value equal to "OK" the text should be green.
can someone help me?
Thank you
 
This code seem works but it takes the first value and repeat the same in every row

<?php
$myElement = (int)'{manutenzioni_programmate_37_repeat___eseguito_raw}';
if ($myElement == 'OK') {
echo '<font color="green">OK</font>';
}
else if ($myElement == 'KO') {
echo '<font color="red">KO</font>';
}
?>
 

Attachments

  • code.jpg
    code.jpg
    30 KB · Views: 127
Last edited:
If the value is text why you cast it as an integer?
Also you have an if...else if structure. What if teh value is not 'OK' nor 'KO'?
Or are there only two possibilities?
 
a single element should change color based on its value...
then I'd like to customize the list and the pdf that is generated

can U help me?


sorry but I'm not very expert in this component but it seems to me very powerful
 
Last edited:
I managed to create a customized template as a detail but the generated pdf does not look like the detail itself.
How can I create a customized template for pdf too? I read the instructions but I don't know how to recall the various elements.

Thank you
 
I sow but how can I create PDF template with (only) name | city | note for example?
default.php file returns all elements

$this->elements = $group->elements;
echo $this->loadTemplate($group->tmpl);

???
 
thank you!

now I have my custom details (see attachment) but the pdf generated look without stylesheet (second attachment)
PDF library is DOMPDF
J 3.9.19
PHP 5.6
Fabrik 3.9
installed in a local machine (XAMPP)

with debug PDF enable, it create a new page as you can see in the attachment but not a PDF as a new file
 

Attachments

  • detail.jpg
    detail.jpg
    54.5 KB · Views: 114
  • pdf.jpg
    pdf.jpg
    52.6 KB · Views: 119
  • debug_on.jpg
    debug_on.jpg
    52.8 KB · Views: 106
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top