• 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.

[SOLVED] Change Element color (date) if value is less than two years ago

maxinic

Member
Hy everyoneI
I have a form with a date type element. I would like to turn red format if the date entered is before two years ago. is it possible to do it in the list? sorry i resumed fabrik after 9 years and i'm a bit rusty
 
Maybe the following post will u an idea:
https://fabrikar.com/forums/index.php?threads/solved-conditional-formatting.49361/#post-257790

I would compare the date based on current and return the color accordingly.

BTW..You post on a forum refering to old version of Joomla (2.5).



i followed the post and now i have a calc field (set this element to "Use as row class" in List view settings) which returns me a css class name. Now I have edited my custom_css.php but nothing happens. this is my custom_css.php :

header('Content-type: text/css');
$c = $_REQUEST['c'];
echo <<<EOT
/* BEGIN - Your CSS styling starts here */


#listform_$c tr.colred td.anagtafica___diffdata {color:red;};
#listform_$c tr.colwhite td.anagtafica___diffdata {color:white;};

#listform_$c {
margin-top: 25px !important;

}
 
The calc element should return a string based on the date comparison.
Based on that string value you prepare the custom_css.php
Have you followed this procedure?
 
The calc element should return a string based on the date comparison.
Based on that string value you prepare the custom_css.php
Have you followed this procedure?

First of all, Thanks Dimoss
Yes my calc element can return only 2 string: colred or colwhite so i have edited my custom_css.php

so:
#listform_$c tr.colred td.anagtafica___diffdata {color:red;};
#listform_$c tr.colwhite td.anagtafica___diffdata {color:white;};
but nothing happen
(if i print my calc element it's return colred or colwhite)
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top