A+ R A-

Adding Plugin Code to an HTML Module

E-mail Print
Share/Save/Bookmark

Every time I get a special plugin that can add stuff to content, like attachments, mp3, video, etc. using something like this {link}put your stuff in here{/link} and the plug-in picks up the code and places the video, mp3, download in the content of the article.

AllVideos Reloaded is a good example of this. Try doing this with the HTML Module and you're screwed. Needless to say there are plenty of times I can find a use for this.

You'll need to hack the core index.php file (in the root of the install) and place a code snippet just after line 82.

Find this bit of code:

 

// trigger the onAfterRender events JDEBUG ? $_PROFILER->mark('afterRender') : null; $mainframe->triggerEvent('onAfterRender');

and paste this right after it:

/* * // Allow plugins to be loaded into modules. (Rostislav Palivoda) */ JPluginHelper::importPlugin('content'); $tmp_row->text = JResponse::getBody(); $tmp_params = new JParameter(null); $mainframe->triggerEvent('onMap', array( &$tmp_row, &$tmp_params ), true ); $mainframe->triggerEvent('onPrepareContent', array( &$tmp_row, &$tmp_params ), true ); JResponse::setBody($tmp_row->text);

Now you should be able to put your plugin code in a module.

Be careful though as this may screw up other plugins and modules, so use it with caution.

bamboo2
Joomla Bamboo

praise2
Praise

shape52
Shape 5

icdsoft2
ICDSoft Hosting

rocket2
Rocket Theme

ijoomla2
iJoomla

mightextensions2
Mighty Extensions

mightytemplates2
Mighty Templates


ACE SEF