One of the coolest feature in Joomla content editor is the ability to insert specific modules’ position whereaver you want. This is particularly usefull to loadĀ inline banners or to add quick polls to an article/page just by inserting {loadposition mypostion} in your editor textarea.
In Joomla 1.5.x everything works fine when viewing the page as HTML, but in PDF and print friendly format view these shortcodes aren’t converted nor removed. Moreover displaying these contents could be unnecessary or unwanted.
This problem arise because in pdf and print view files in Joomla com_content component not all content plugins (those addons called mambots) are loaded. In PDF view file components/com_content/views/article/view.pdf.php there’s just one plugin (called image) loaded before the content is outputted (lines 68 -69):
JPluginHelper::importPlugin('content', 'image');
$dispatcher->trigger('onPrepareContent', array (& $article, & $params, 0));
The (dirty) solution
From a quick glance in the plugins/content folder i’ve noticed that there’s no any image.php pluginĀ file in a clean Joomla 1.5.10 installation. So i’ve decided to use this hole and create a custom plugin to clean my content without messing up the core com_content code.
After installing the plugin and activating it you are given (at the moment) two options:
- a radio to clean loadposition code (defaults to
Yes) - a textarea for typing custom regular expressions (one per line).
In this last field remember to omit backslashes (/) instead write curly brackets, for example {code\s*[a-zA-Z]}
Here is the package for download: plg_image (clean plugins code) (1.79 KB)
As always feedbacks and suggestions are welcome.
Tags: com_content, joomla, Joomla 1.5, joomla plugin
One Response to this post:

This is great thank you. However, I am just not getting the syntax right for the last field. I have {/jgototop} what should I enter it as please…
Many thanks