1. If you update to Joomla 3.8.10, please make sure that you either do a full GitHub update of Fabrik, or disable caching for your lists (in the Advanced settings) or turn off Joomla's System Cache setting. A change in Joomla's cache code in 3.8.10 required a fix in Fabrik, which will be rolled in to the next release, but is currently only available in GitHub.

Render a single element in a form

Nov 29, 2013
Render a single element in a form
  • In your form templates element's are rendered in the sub template default_group.php


    Is an array of element objects, keyed on the element name.
    By default the default_group.php sub template loops over the element's and renders them all out.

    Often in a custom template we want to get a specific element, so if I wanted to access the element named 'age' I could do:


    $ageElement = $this->elements['age'];
    Each element is an object with a series of properties:
    • plugin - the element's plugin e.g. 'field'
    • id - Unique reference, e.g. 'tablename___name'
    • element - the HTML field e.g. <input .... />
    • label_raw - the label as plain text
    • label - the label text wrapped in its <label/> tag
    • value - the value assigned to the element
    • error - any error message generated from a fail validation
    • column (fabrik 3.0 only) css used to build group columns
    To output the element's value we can write this PHP:

    echo $ageElement->value;