PDF templates location to use with email plugin PDF

Hi,
I found this article which provides path for templates to use to generate PDF :
http://fabrikar.com/forums/index.php?wiki/pdf-output/

So , I created a copy of the directory 'bootstrap' in the following directory :
Joomla 2.5+: Details: components/com_fabrik/views/details/tmpl25/

In the layout tab of the form, I can now see a new PDF template available ( named as per the directory I just created )
I modified the default.php to double check that everything is ok , with the code below, but it doesn't to make any changes ... ( inserted some text to display on several locations )

am I changing the right files at the right location ?
or am I missing something in the process ?
thx !

Code:
<?php
/**
* Bootstrap Details Template
*
* @package  Joomla
* @subpackage  Fabrik
* @copyright  Copyright (C) 2005-2016  Media A-Team, Inc. - 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');
?>
<div id="footdompdf">
  <span class="footleft"><?php echo $this->table->label;?></span>

  <span class="pagenum">Page </span>
</div>
<div id="headerdompdf">
  <span class="headleft"><?php echo $this->table->label;?></span>
  <span class="pdfdate">19-11-2013</span>
</div>
<?php
$form = $this->form;
$model = $this->getModel();

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;

<div class="page-header">

   <h1>voici mon texte !</h1>
</div>


if ($this->params->get('show-title', 1)) :?>
<div class="page-header">
   <h1><?php echo $form->label;?></h1>
   <h1>voici mon texte BIS !</h1>
</div>
<?php
endif;

echo $form->intro;
if ($this->isMambot) :
   echo '<div class="fabrikForm fabrikDetails fabrikIsMambot" id="' . $form->formid . '">';
else :
   echo '<div class="fabrikForm fabrikDetails" id="' . $form->formid . '">';
endif;
echo $this->plugintop;
echo $this->loadTemplate('buttons');
echo $this->loadTemplate('relateddata');
foreach ($this->groups as $group) :
   $this->group = $group;
   ?>

     <div class="<?php echo $group->class; ?>" id="group<?php echo $group->id;?>" style="<?php echo $group->css;?>">

     <?php
     if ($group->showLegend) :?>
       <h3 class="legend">
         <span><?php echo $group->title;?></span>
       </h3>
     <?php endif;

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

     // Load the group template - this can be :
     //  * default_group.php - standard group non-repeating rendered as an unordered list
     //  * default_repeatgroup.php - repeat group rendered as an unordered list
     //  * default_repeatgroup_table.php - repeat group rendered in a table.

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

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

echo $this->pluginbottom;
echo $this->loadTemplate('actions');
echo '</div>';
echo $form->outro;
echo $this->pluginend;
 
No, you aren't missing something. That's been an issue for a while, getting the "wrong" PDF template when generating email attachments. It's an issue to do with the way Joomla assigns the default document type. Because the email template is being generated from within a "normal" (format=html) page load (rather than from a direct ...&view=details&format=pdf page load, like when you hit the PDF button on the front end) where we then have to play back-door games to convince Joomla to then let use create a PDF document type (format=pdf) ... things get a little weird.

I think I finally, just now, found a way to convince J! to let us do it. Testing, will let you know.

-- hugh
 
I committed the changes a couple of weeks ago.

Try a full github update, see if it fixes your issue.

As usual, we strongly advise doing a full site backup first (Akeeba Is Your Friend).

-- hugh
 
Hi Hugh,
Seems that there is an issue on a file syntax ( see attached )
tried to search alone but out of my competences ....
Thx!
 

Attachments

  • pdf.error.jpg
    pdf.error.jpg
    55.2 KB · Views: 19
When do you get this, when saving your form with email plugin with "Attach PDF"?
Is this with your custom PDF template or also with the standard bootstrap (selected as PDF template)?

And I assume you are not really using "Joomla 2.5+: Details: components/com_fabrik/views/details/tmpl25/"?
 
Was obvious for me , sorry, as I have only 1 form online for now ...
this error occurs when I submit the form ?but your question raised the location of the issue I think
if I use bootstrap, no errors.
I'm using a copy of bootstrap ( I copied the initial directory ). so I guess I have to review my template !
 
Hello ,
Answering for potential same issues....
this is a note for french speakers " ensure your database is defined with unicode or all ?,?,? will create problems).
Fabrik replace automatically all ?,?,? ... by "_" in table names to avoid such issues, pay attention in your code to do the same....
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top