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

Other template examples

  • Views Views: 10,192
  • Last updated Last updated:
  • Showing error messages in-line​

    Clone your template and edit your default_element.php to look like this:

    PHP:
    <?php
    /**
    * Default Form:Group Template - show error messages inline
    *
    * @package Joomla
    * @subpackage Fabrik
    * @copyright Copyright (C) 2005 FabrikAll rights reserved.
    * @license [URL]http://www.gnu.org/copyleft/gpl.html[/URL] GNU/GPL, see LICENSE.php
    * @since 3.0
    **/

    /*
    This part of the template is what actually renders each individual element. You will be loading this
    template multiple times (once for each element you want to display) from your default_group.php file.

    You probably won't need to edit this file - most changes you want can probably be done
    by overriding the template_css.php file in your J template html overrides folder

    If you do edit this file, make sure you use the same parts of the element this example uses,
    i.e. the same class definitions, etc.
    */
    ?>

    <?php if ($this->tipLocation == 'above') {
    echo '<div>' . $element->tipAbove . '</div>';
    }?>

    <?php
    // As this is a custom template, you may want to exclude $this->element->column
    // which is the inline css required to abide by the group's column setup
    ?>

    <div <?php echo @$this->element->column;?> class="<?php echo $this->element->containerClass;?>">
    <div class="fabrikElement">
    <?php echo $this->element->element;?>
    <?php if ($this->element->error != "") :?>
    <?php echo $this->element->error;?>
    <?php endif;?>
    </div>
    <?php if ($this->tipLocation == 'side') {
    echo $element->tipSide;
    }?>
    <div style="clear:both"></div>
    </div>

    <?php if ($this->tipLocation == 'below') {
    echo '<div>' . $element->tipBelow . '</div>';
    }?>

    <?php
    $this->element->rendered = true;
    ?>

    Showing an element only if it has a value​


    Say we want to hide the element 'countries___id', when it has no value. Clone your form/details template, and the edit its default_group.php file:
    PHP:

    <?php

    // No direct access
    defined('_JEXEC') or die('Restricted access');

    foreach ($this->Elements as $element) :
    if ($element->id === 'countries___id' && $element->value == '') :
    continue;
    endif;
    // Render the rest of your group template as usual......
    <?php endforeach;?>
    [php]
Back
Top