• 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] Custom_css and calc element

maxinic

Member
Hy everyone
I have a simple calc element (use as a row class):

$abrogata = ('{ordinarie___abrogata}');
if ($abrogata = 1)
{ return 'colrosso'; };

Where ('{ordinarie___abrogata}') is a yes/no element.

This is my custom_css.php
#listform_$c {
margin-top: 25px !important;
}
#listform_$c tr.colred td.ripiegamenti___data_ripiegamento {color:red;};
#listform_$c tr.ordinarie.colrosso td.ordinarie__TITOLO {color:red;};

Unfortunately nothing change on my rows. Any tips for me?


 
Try:

$abrogata = '{ordinarie___abrogata_raw}';
if ($abrogata == 1)
{ return 'colrosso'; }

And also remove semicolons after the closing brackets in custom_css.php, that means } instead of };

And make sure with browser inspect function that the class which "mark as row class" function adds, is the one that you have in custom_css.php
 
Try:

$abrogata = '{ordinarie___abrogata_raw}';
if ($abrogata == 1)
{ return 'colrosso'; }

And also remove semicolons after the closing brackets in custom_css.php, that means } instead of };

And make sure with browser inspect function that the class which "mark as row class" function adds, is the one that you have in custom_css.php

Thanks for the reply juuser but i think that the problem is in Custom_css.php because calc element works well
upload_2021-4-22_9-50-19.png
could it be that by returning a number (1) I have to add something?
 
You have to check the right class name with browser inspect function. For the element called "myelement", added class is something like "myelement_1" when elements value is "1".
 
in fact the custom_css is not applied
how can you see:

upload_2021-4-22_10-42-36.png

however my class name should be colrosso not a number
I'm confused :)
 
Check in your browser console if the class is added to the tr (not td), if your CSS "source" is loaded correctly etc.
 
This is from my browser

upload_2021-4-22_11-51-15.png
 

Attachments

  • upload_2021-4-22_11-48-14.png
    upload_2021-4-22_11-48-14.png
    51.3 KB · Views: 76
  • upload_2021-4-22_11-49-48.png
    upload_2021-4-22_11-49-48.png
    28.5 KB · Views: 66
So colrosso is correctly added.

Check in the browser if your custom_css.php is loaded correctly (you may have a typo breaking the CSS...), you should get something like this
upload_2021-4-22_12-35-14.png
 
I just found that it seems you have/had a missing _ in your CSS
#listform_$c tr.ordinarie.colrosso td.ordinarie__TITOLO {color:red;}; it must be 3_
#listform_$c tr.ordinarie.colrosso td.ordinarie___TITOLO
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top