Plugin for calls to joomla component

How can I call the joomla plugin 'Simple Picture Slideshow' in any joomla component. Is there a solution?

thanks

+4
source share
4 answers

You can trigger any plugin event that is defined in this plugin.

$dispatcher = JDispatcher::getInstance(); $data = array($argu1, $argu2); // any number of arguments you want return $dispatcher->trigger($eventName, $data); 
+3
source

The best way to trigger content plugins in Joomla! 1.5 and above is simply used:

 $text = JHTML::_('content.prepare', $text); 

http://docs.joomla.org/Triggering_content_plugins_in_your_extension

+6
source

In Joomla, plugins are not called in the typical sense, they are triggered by various events. The plugin listens for a specific event that fires it. In this case, you need to look and see what Simple Slideshow is listening to, and then add this trigger to your component. The only way to guarantee that the plugin will run all the time is to listen to one of the global system events, this happens regardless of the code in the component, they occur at the frame level. If the plugin is triggered by a non-global event, you need to either change the plugin or add an event for each component that you want to use with the plugin.

Link to global system events - http://docs.joomla.org/Reference:System_Events_for_Plugin_System

Link to the plugin - http://docs.joomla.org/Plugin

+2
source

This question is specifically for the Content joomla plugin.

You can fire any plugin event in your component.

Here is an example of triggering a Content plugin onPrepareContent .

 $content = new stdClass; $content->text = 'Your content body with proper tag or content wich you want to replace. For example: {loadmodule mod_login}'; $atricle = array(); JPluginHelper::importPlugin('content'); $dispatcher = JDispatcher::getInstance(); JDispatcher::getInstance()->trigger( 'onPrepareContent', array( &$content, &$atricle, null ) ); 

Or if you want to run only a specific plugin for your component, you can use

 JPluginHelper::importPlugin('content', 'loadmodule'); 

The second argument is the name of the plugin you want to use.

Similarly, you can trigger a user plugin event in your component.

 JPluginHelper::importPlugin('user', 'contactcreator'); JDispatcher::getInstance()->trigger( 'onUserAfterSave', array( $user, $isnew, $success, $msg ) ); 
+1
source

All Articles