Joomla 1.0 Articles
- How to create a module with DirectPHP plugin?
- How to include modules in Content item?
- How to include modules in Section/Content Description
- How to include PHP commands in Section/Content Description
- How to make plugins process Section/Category descriptions
- Include Code Listing plugin - More Tips and Techniques
- How to have DirectPHP plugin process RSS feed?
- How to have the plugins processed when genrating PDF documents of content items?
- How to have DirectPHP commands processed in Joomla search?
Joomla 1.5 Articles
- How to create a module with DirectPHP plugin?
- How to include modules in Content item?
- How to include modules in Section/Content Description
- How to include PHP commands in Section/Content Description
- How to make plugins process Section/Category descriptions
- Include Code Listing plugin - More Tips and Techniques
- How to have DirectPHP plugin process RSS feed?
- How to have the plugins processed when genrating PDF documents of content items?
- How to have DirectPHP commands processed in Joomla search?
|
How to have the plugins processed when genrating PDF documents of content items (for Joomla 1.0.x)? |
| Written by kksou | ||
| Sunday, 15 June 2008 | ||
|
In a standard Joomla 1.0 installation, you can generate a PDF version of a content item by clicking on the pdf icon appearing in the top right corner of the content item page. However, if you have installed some plugins or mambots such as the Include Content Item or the googleAds plugins, you will find that the plugin do not get processed during the generation of the PDF documents. As as result, you will see the plugin tags such as {googleAds} or {include_content_item}, appearing in the PDF documents! This is, of course, undesirable. This article shows you how to have the plugins processed during the generation of the PDF documents for content items. Note: the steps below are for Joomla 1.0.x. If you're using Joomla 1.5.x, please refer to How to have DirectPHP plugin process RSS feed (for Joomla 1.5.x)?. ExplanationIn the original Joomla installation, there is no trigger during the generation of PDF documents. When there is no trigger, none of the plugin gets called. In order for the plugins to be processed, we need to add a trigger. SolutionsAll you need is to add 6 lines to have plugins processed during the generation of PDF documents!
$txt1 = $row->title;
$pdf->ezText( $txt1, 14 );
$txt2 = AuthorDateLine( $row, $params );
$pdf->ezText( $txt2, 8 );
$txt3 = $row->introtext ."\n". $row->fulltext;
global $_MAMBOTS;
$params = array();
$row->text = $txt3;
$_MAMBOTS->loadBotGroup( 'content' );
$results = $_MAMBOTS->trigger( 'onPrepareContent', array( 1, &$row, &$params, 0) );
$txt3 = $row->text;
$pdf->ezText( $txt3, 10 );
$pdf->ezStream();
That's it! Now try generating the PDF documents. You should find all the plugin tags disappear in the PDF documents as they get processed by the respective plugins. NoteFor plugins such as googleAds, you will find that the plugin gets processed, but the resulting google Adsense codes do not get run by Joomla 1.0. (Joomla 1.5 works fine.) For such plugins on Joomla 1.0, the only way may be is to remove the plugin tags from the content item during the generation of PDF. For the googleAds plugin, I've written the corresponding plugin to remove the tag from the content item here. (will be released in a couple of days time) User reviews There are no user reviews yet. Note: You have to be a registered member to leave a comment. Free registration here. |
||
| < Prev | Next > |
|---|


