How to call individual elements in "default_group.php" template.

Status
Not open for further replies.

dealio

Member
Hi,

In fabrik 3.08 their was a "contact_custom" template which showed how to call each individual form field element. Is there something similar in 3.1?

For example in "default.php"
------------------------------------
echo $this->loadTemplate('group');



What would the syntax be for 3.1 "default_group.php" to call each individual element a group?
---------------------------------------------------
<?php
$this->element = $this->groups['Form1-[mytable_my_content]']->elements['first_name'];
echo $this->loadTemplate('group_labels_side');
?>




Sorry if this has already been asked I couldn't find it when searching.

Thanks
 
Hi - I think it should work in the way you are already describing, is it not working?
 
Hi Rob, It does work however the save button stops responding. I put the following in the default_group.php




=====default_group.php======================
<?php
/**
* Bootstrap Form Template - Group
*
* @package Joomla
* @subpackage Fabrik
* @copyright Copyright (C) 2005-2013 fabrikar.com - All rights reserved.
* @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
* @since 3.1
*/

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

?>

<fieldset class="fs_report-section" id="fs_report-section" style="display: block;">
<legend class="fs_report-section"><span class="fs_report-section">Report Information</span></legend>
<?php
$this->element = $this->groups['My Reports']->elements["id"]; echo $this->loadTemplate('element');
$this->element = $this->groups['My Reports']->elements["date_time"]; echo $this->loadTemplate('element');
$this->element = $this->groups['My Reports']->elements["rpt_updated"]; echo $this->loadTemplate('element');
$this->element = $this->groups['My Reports']->elements["createdby"]; echo $this->loadTemplate('element');
$this->element = $this->groups['My Reports']->elements["rpt_reportno"]; echo $this->loadTemplate('element');
$this->element = $this->groups['My Reports']->elements["rpt_date"]; echo $this->loadTemplate('element');

?>
</fieldset>

<?php
//handling hidden
echo $this->loadTemplate('hidden');
?>

=====================================================


Within the default.php I commented out the foreach and just put,

echo $this->loadTemplate('group');








I'm not sure if this is a separate issue or relate but calling the date field But the javascript that formats the date element is formatting the date which converts it incorrectly.


Steps.
Add a date element such as above ["rpt_date"]

1. Add a date element and set the ["rpt_date"] format to "m/d/Y" in the element configuration settings.
2. Add "$this->element = $this->groups['My Reports']->elements["rpt_date"]; echo $this->loadTemplate('element');"
to default_group.php


3. Create a record and enter "9/23/2013" for the ["rpt_date"] field
4. Click on Apply
5. Go to list and edit the form.
6. Change the date to "10/23/2013"
7. Click on apply
8. Notice the date shows as "09/10/2190"

This is only happens with you call each element independently on the default_group.php

If this is non related I can create a new thread.




Thanks
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top