Form Template/PDF Template Layout (Group Layout) - Solved

startpoint

Active Member
Hi,
I have 3 groups with elements. I want to display these groups inline.
How to use boostrap classes span1 - span12. I know how to use for element's layout in group, but did not find a way to apply them to groups in a form.

Thank you in advance for your suggestions.
 
I would have to agree with myfatebiz. Creating a custom template isn't to tough. They way I have done this is by looking at the $this->groups array. This array holds your different groups in sub arrays and you can then use them in a foreach with $this->groups['group_name']. It's what I've done to separate my groups in a template for a registration form.
 
Hi,

please give me a detail code example.
My form have 3 groups, which need to be display inline, and other group, which need to be 100% width after others.
How to exclude the 4 group from foreach cycle in template default.php?
 

Attachments

  • form-1.jpg
    form-1.jpg
    374.4 KB · Views: 884
Hi,
Based on the instructions of Valinor was tried to change the template and it became successful.
Below share my experience with the examples, it can be useful to others.
These codes must be in:
for Form Template: components/com_fabrik/views/form/tmpl/template_name
or
for Form Details View/PDF Template: components/com_fabrik/views/details/tmpl/template_name

Show All Data From Groups In Form (Array)
PHP:
echo "<pre>";
print_r($this->groups);
echo "</pre>";

Show Group Names with keys From Groups In Form (Array)
PHP:
echo "<pre>";
print_r(array_keys($this->groups));
echo "</pre>";

Show All Elements From Group (Array)
PHP:
echo "<pre>";
$group_name = $this->groups['group_name'];
$elements = $group_name->elements;
print_r(array_keys($elements));
echo "</pre>";

Show Element value From Group
PHP:
$group_name = $this->groups['group_name'];
$elements = $group_name->elements;
$element_value = $elements ['element_name']->element;
//$element_value = $elements ['element_name']->element_raw;
//print_r($element_value);
echo $element_value;

Display All Group Data And Elements (standard group non-repeating)
PHP:
<div class="span4">
    <?php
    $group = $this->groups['group_name'];
    $this->group = $group;
    ?>
    <fieldset class="<?php echo $group->class; ?>" id="group<?php echo $group->id;?>" style="<?php echo $group->css;?>">
        <?php
        if ($group->showLegend) :?>
            <legend class="legend"><?php echo $group->title;?></legend>
        <?php
        endif;

        if (!empty($group->intro)) : ?>
            <div class="groupintro"><?php echo $group->intro ?></div>
        <?php
        endif;

        $this->elements = $group->elements;
        echo $this->loadTemplate($group->tmpl);

        if (!empty($group->outro)) : ?>
            <div class="groupoutro"><?php echo $group->outro ?></div>
        <?php
        endif;
    ?>
    </fieldset>
</div>

Display All Group Data And Elements (repeat group)
PHP:
<div class="row-fluid">
    <?php
        $group = $this->groups['group_name'];
        $this->group = $group;
    ?>
    <fieldset class="<?php echo $group->class; ?>" id="group<?php echo $group->id;?>" style="<?php echo $group->css;?>">
        <?php
        if ($group->showLegend) :?>
            <legend class="legend"><?php echo $group->title;?></legend>
        <?php
        endif;

        if (!empty($group->intro)) : ?>
            <div class="groupintro"><?php echo $group->intro ?></div>
        <?php
        endif;

        $this->elements = $group->elements;
        echo $this->loadTemplate($group->tmpl);

        if (!empty($group->outro)) : ?>
            <div class="groupoutro"><?php echo $group->outro ?></div>
        <?php
        endif;
    ?>
    </fieldset>
</div>

If anyone has any suggestions or recommendations on improving the code will be happy to share them.
I hope to help someone.
 
Last edited:
Try (repeat group) on joomla 3.6.2 and fabrik 3.5.1 ? get error about JS in load

JavaScript:
autocomplete didn't find input element mootools-ext.js (line 2)
TypeError: a is null
b=a.getElement("input[name*=-auto-complete]");  databasejoin-min.js (line 2, col 14535)

if on repeatgroup try enter in autocomplete filed get this error:

JavaScript:
TypeError: g is null
...(g=f.formElements.get(this.element.id),h=g.getBlurEvent(),this.element.fireEvent...
autocomplete-bootstrap.js (line 2, col 4007)
 
Your question doesn't seem to be related to this thread. Can you post a new thread, with more details about how to reproduce the error.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top