Is there a way to create a custom printer friendly template.

Status
Not open for further replies.

dealio

Member
Is there a way to create custom printer friendly templates.


On the form page there is a Print button. Is there a way to specify a custom template just for printing? it looks like its just using the details template.

Also is there a way to make multiple print buttons and point them to a different template
My goal is to have two print buttons. One button to print only summary (short content) and another button to print he full details content (long content) .


Can it be done using the url or would this have be be done hacking at core files?

...=component&view=details&formid=12&listid=12&rowid=116&iframe=1&print=short_version
...=component&view=details&formid=12&listid=12&rowid=116&iframe=1&print=long_version

like:

$url = COM_FABRIK_LIVESITE . 'index.php?option=com_' . $package . '&tmpl=component&view=details&formid=' . $form->id . '&listid=' . $table->id
. '&rowid=' . $formModel->getRowId() . '&iframe=1&print=1';


thanks
 
I would try using the layout=my_detail_template parameter. Copy ../views/details/tmpl/bootstrap folder into another one and rename it my_detail_template. From there, you need to make your own template/layout.

I'm trying similar task with the pdf. Only with the pdf, no css is loaded. I don't know yet about the print in details.
 
If it were me, I would use CSS (i.e. @media print { ... } ) to change the layout when user clicks print.

I would imagine that you will need to change the CSS for both the overall web page (i.e. your Joomla template) and possibly the Fabrik elements as well.

Note: If you already have a responsive Joomla template (which does similar things when the page is displayed on e.g. a mobile phone or tablet), then the CSS for tablets could be a good starting point for @media print CSS.
 
Cool thanks. I used both of your suggestions and works nicely.


For those who want to do something similar:

1. Create a link form the forms page following this
http://fabrikar.com/forums/index.php?wiki/javascript-window-class/


===Example in default.php or defualt_group.php=====
<?php
FabrikHelperHTML::script(FabrikHelperHTML::framework());
FabrikHelperHTML::iniRequireJS();
FabrikHelperHTML::windows('a.myFabWin');
$urlFullRport = COM_FABRIK_LIVESITE . 'index.php?option=com_fabrik&tmpl=component&view=details&formid=' .$gitFormid .'&layout=detail_dmv_full_report&listid=' .$gitListid .'&rowid='. $gitRowid .'&iframe=1&print=1';
?>

<a class="btn" href="<?php echo $urlFullRport;?>" class="" rel="{'id':'Full_Report', 'height':500,'title':'Full Report','loadMethod':'iframe', 'onContentLoaded': null}">
View Report
</a>
====End =======


2. Then I used your CSS @media print{} and works well


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

Thank you.

Members online

Back
Top