• New Commercial Services Section

    We have now opened a commercial services section here on the forum. If you have a Fabrik project that you wish to have someone work on for you, post it under Help Wanted. If you are an application developer and wish to earn some money helping others, post your details under Fabrik Application Developers.

    Both of these are unmoderated. It will be up to both parties to work out the details and come to an agreement.

Override a Specific Field

  • Views Views: 13,361
  • Last updated Last updated:

Navigation

  • Each row of your List is rendered with components/com_fabrik/views/table/tmpl/default_row.php. The standard file for this looks like:

    PHP:
    <?php
    defined('_JEXEC') or die( 'Restricted access');
    ?>

    <tr id="<?php echo $this->_row->id;?>" class="<?php echo $this->_row->class;?>">
    <?php foreach ($this->headings as $heading=>$label) {&nbsp;?>
    <td <?php echo $this->cellClass[$heading]?>><?php echo @$this->_row->data->$heading;?></td>
    <?php }?>
    </tr>
    If we want to alter a single cell, in this case replacing the 'email' value with the text 'email address withheld', we can do this:
    PHP:
    <?php
    defined('_JEXEC') or die( 'Restricted access');
    ?>

    <tr id="<?php echo $this->_row->id;?>" class="<?php echo $this->_row->class;?>">
    <?php foreach ($this->headings as $heading=>$label) {&nbsp;?>
    <td <?php echo $this->cellClass[$heading]?>>
    <?php if ($heading == 'tablename___email') {
    echo "email address witheld';
    } else {
    echo @$this->_row->data->$heading;
    }?>
    </td>
    <?php }?>
    </tr>
    Easy when you know how.
Back
Top