1. Fabrik 3.7 is now available. This version contains critical security updates, please update as soon as possible. Please remember to backup your site before updating, we also recommend testing your updates on development sites if possible.
  2. We had to restore the site around midday (CST) on Wed 7/26 from a backup approximately 8 hours old. So a few posts in the forums were lost. You may want to check to see if you need to re-post anything.
  3. The release of Fabrik for J! 3.8 is not yet ready. Do not update your sites to J! 3.8 until this notice is removed.

Other template examples

Oct 23, 2013
Other template examples

  • Showing error messages in-line (top)

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

    Code (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(top)


    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]
nettemor likes this.