Creating a new Details View Template

peterk900

Member
I am using Rob's video to try and understand how I can create a custom template to show detailed record information in a layout that I specify. This video removes a lot of code from default.php ( located in a new folder created in /components/com_fabrik/views/form/tmpl )

I am using a copy of the Contact Us list.

The video tests the results of the pruning default.php with a url like ..../index.php/contact-us2/details/3/1/layout=boot40form where contact-us2 is the cloned contact list and boot40form is the new pruned template. The result should be a blank form ready for code to pick individual fields and place them in custom positions.

When I use the url above I see the same data as with the unaltered bootstrap template. Changing the front end form to use boot40form in the form layouts tab has no effect.

What have I missed ? Thanks.
 
The URL to test templates is by appending
?layout=boot40form (if it's the first URL parameter) or &layout=boot40form

Details templates are in the folder
/components/com_fabrik/views/details/tmpl
 
Thanks for correcting my query string but I still get the form displayed using the original template. In case it's helpful the details are below, including the url. I sense I'm still missing something mega-obvious !


http://marionandpeter.com/8Day100/index.php/contact-us2/details/5/2?layout=boot40form

default.php (.../components/com_fabrik/views/form/tmpl/boot40form)

<?php
/**
* Bootstrap Form Template
*
* @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');

$form = $this->form;
$model = $this->getModel();

$active = ($form->error != '') ? '' : ' fabrikHide';

if ($this->params->get('show_page_heading', 1)) : ?>
<div class="componentheading<?php echo $this->params->get('pageclass_sfx')?>">
<?php echo $this->escape($this->params->get('page_heading')); ?>
</div>
<?php
endif;

if ($this->params->get('show-title', 1)) :?>
<div class="page-header">
<h1><?php echo $form->label;?></h1>
</div>
<?php
endif;
echo $form->intro;
?>
<form method="post" <?php echo $form->attribs?>>
<?php
echo $this->plugintop;
?>
<div class="row-fluid nav">
<div class="span6 pull-right">
<?php
echo $this->loadTemplate('buttons');
?>
</div>
<div class="span6">
<?php
echo $this->loadTemplate('relateddata');
?>
</div>
</div>

<?php

echo $this->pluginbottom;
echo $this->loadTemplate('actions');
?>
</form>
<?php
echo $form->outro;
echo $this->pluginend;

fabrik0508b.png
 
You must create a details template in the details folder
default.php (.../components/com_fabrik/views/details/tmpl/boot40form)
 
I new it was something silly on my part ! We've now got the blank form as I would expect - and I now know why I didn't see any new templates in the Details view drop down ( Form -> Layouts ) when they appeared in the Template drop down above.

Thanks again for your help.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top