• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

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