1. "Fabrik 4" helpers needed!

    You are invited to join other community members active in coding, maintaining and improving Fabrik. Please visit https://fabrik.help for more information!
    Dismiss Notice

Accessing Value in Repeat Group of Detail in Table layout

Discussion in 'Community' started by milesreid, Dec 5, 2022.

  1. milesreid

    milesreid New Member

    Level: Community
    In a customisation of a detail layout for DOMPDF I am trying to color certain cells differently depending on the value of that cell, but am having difficulty in accessing the individual value for the column in each row. The rows are being rendered as a table.

    In a table 'hazard_evaluation' with column 'initial_risk' I find that {hazard_evaluation___initial_risk} contains, as one would expect, an array of values of that column for both rows - in my test data 27,6

    How can I access the value of the column in the PHP in default_repeat_group_row.php so that I can set the name of the CSS class as a PHP variable? The solution that I am trying to achieve is:

    Code (Text):
    <div  class="fabrikElement  <?php echo $backgroundColorClass?>  ">
                    <span ><?php echo $element->element;?></span>
    Attached is a screenshot of what I'm trying to achieve - the colours being dependent upon the value in the cell


    Attached Files:

    Last edited: Dec 6, 2022

Share This Page