How to call plugin inside component for joomla 1.5?
- shibu
- Joomla! Guru
- Posts: 681
- Joined: Fri Oct 24, 2008 5:35 am
- Location: Openkey Technologies, India
- Contact:
How to call plugin inside component for joomla 1.5?
I want to call plugin inside a component for joomla 1.5.
Please help me as soon as posible.
Thanks and regards
Shibu
Please help me as soon as posible.
Thanks and regards
Shibu
http://www.openkeytech.com/ - Joomla Extension Development
- shibu
- Joomla! Guru
- Posts: 681
- Joined: Fri Oct 24, 2008 5:35 am
- Location: Openkey Technologies, India
- Contact:
Re: How to call plugin inside component for joomla 1.5?
I want the code.
Thanks and regards
Shibu
Thanks and regards
Shibu
http://www.openkeytech.com/ - Joomla Extension Development
-
- Joomla! Explorer
- Posts: 255
- Joined: Mon Jul 10, 2006 8:16 pm
- Location: CA
- Contact:
Re: How to call plugin inside component for joomla 1.5?
shibu,
What kind of plugin do you want to call? Do you want to import it and have access to parameters set in the plugin?
What kind of plugin do you want to call? Do you want to import it and have access to parameters set in the plugin?
- shibu
- Joomla! Guru
- Posts: 681
- Joined: Fri Oct 24, 2008 5:35 am
- Location: Openkey Technologies, India
- Contact:
Re: How to call plugin inside component for joomla 1.5?
The plugin type is system plugin.
I want both.
The plugin description is shown below.
Users to a JUGA group depending on the product they purchased in Virtuemart.
I want both.
The plugin description is shown below.
Users to a JUGA group depending on the product they purchased in Virtuemart.
http://www.openkeytech.com/ - Joomla Extension Development
-
- Joomla! Explorer
- Posts: 255
- Joined: Mon Jul 10, 2006 8:16 pm
- Location: CA
- Contact:
Re: How to call plugin inside component for joomla 1.5?
shibu,
Please check out this post I created earlier today and let me know if it's helpful:
http://forum.joomla.org/viewtopic.php?f=304&t=341016
Please check out this post I created earlier today and let me know if it's helpful:
http://forum.joomla.org/viewtopic.php?f=304&t=341016
- shibu
- Joomla! Guru
- Posts: 681
- Joined: Fri Oct 24, 2008 5:35 am
- Location: Openkey Technologies, India
- Contact:
Re: How to call plugin inside component for joomla 1.5?
Thanks for your soon reply.
But its only getting the plugin parameters.
I want to plugin call function.
"I am working in virtuemart for joomla 1.5.
At the end of checkout thank you page.
I want to call a plugin."
I don't konw the call function ..
Thanks and regards
Shibu
But its only getting the plugin parameters.
I want to plugin call function.
"I am working in virtuemart for joomla 1.5.
At the end of checkout thank you page.
I want to call a plugin."
I don't konw the call function ..
Thanks and regards
Shibu
http://www.openkeytech.com/ - Joomla Extension Development
-
- Joomla! Explorer
- Posts: 255
- Joined: Mon Jul 10, 2006 8:16 pm
- Location: CA
- Contact:
Re: How to call plugin inside component for joomla 1.5?
Well, after you do the import of the plugin, at that point you should be able to execute any of its functions in your code when you need to, so that should work fine I think.
- shibu
- Joomla! Guru
- Posts: 681
- Joined: Fri Oct 24, 2008 5:35 am
- Location: Openkey Technologies, India
- Contact:
Re: How to call plugin inside component for joomla 1.5?
Yes , correct.
http://www.openkeytech.com/ - Joomla Extension Development
- ianmac
- Joomla! Virtuoso
- Posts: 4784
- Joined: Sat Sep 24, 2005 11:01 pm
- Location: Toronto, Canada
Re: How to call plugin inside component for joomla 1.5?
Just do:shibu wrote:Yes , correct.
$mainframe = &JFactory::getApplication();
$mainframe->triggerEvent('onAfterInitialise'); // or other event
Ian
- shibu
- Joomla! Guru
- Posts: 681
- Joined: Fri Oct 24, 2008 5:35 am
- Location: Openkey Technologies, India
- Contact:
Re: How to call plugin inside component for joomla 1.5?
Thanks.
http://www.openkeytech.com/ - Joomla Extension Development
-
- Joomla! Apprentice
- Posts: 5
- Joined: Tue Dec 02, 2008 11:34 pm
Re: How to call plugin inside component for joomla 1.5?
I have a follow-up question. I am using the aWiki component extension and have the text stored in a variable "$article". I simply want to run the text of the aWiki article through the same filters/plugins that are run on my articles that are written within Joomla!. This is the view.html.php file:
I have added all the lines which have comment marks after them. I'm fairly sure that my problem lies with the line indicated, but to be honest, I don't know what params are needed to run through all the various plugins. I know all the ones I'm looking to implement are search-and-replace style ones, so they don't actually use any of the params passed to them.
The code doesn't return any error messages in the log file, it renders the wiki text quite well. It just doesn't actually do any of the search and replaces. (for an example, I am using the WikiBot plugin)
If you need any other code or information, please let me know!
Thanks,
Justin
Code: Select all
function display($tpl = null)
{
global $mainframe;//
$model =& $this->getModel();
$article = $model->getArticle();
$mainframe = &JFactory::getApplication();//
$params =& $mainframe->getParams('com_awiki');//
$mainframe->triggerEvent('onPrepareContent', array( & $article, & $params, 0)); // HERE
$this->assignRef( 'article', $article );
parent::display($tpl);
}
The code doesn't return any error messages in the log file, it renders the wiki text quite well. It just doesn't actually do any of the search and replaces. (for an example, I am using the WikiBot plugin)
If you need any other code or information, please let me know!
Thanks,
Justin
- MeeDNite
- Joomla! Enthusiast
- Posts: 249
- Joined: Sun Sep 21, 2008 3:31 am
-
- Joomla! Apprentice
- Posts: 9
- Joined: Tue Jan 04, 2011 9:40 am
Re: How to call plugin inside component for joomla 1.5?
hello,
i have same problem related with plugin. The scenario is that i have one custom module. In that module i fetch some articles from database and display it. And i used one plugin for facebook share, tweet button. when article's detail page will load that plugin properly. But when that module will load plugin not able to display that button.
i want to know that how do i call that plugin or any method of that plugin in my custom module.
Thanks.
i have same problem related with plugin. The scenario is that i have one custom module. In that module i fetch some articles from database and display it. And i used one plugin for facebook share, tweet button. when article's detail page will load that plugin properly. But when that module will load plugin not able to display that button.
i want to know that how do i call that plugin or any method of that plugin in my custom module.
Thanks.
-
- Joomla! Fledgling
- Posts: 3
- Joined: Thu Jul 15, 2010 11:45 am
Re: How to call plugin inside component for joomla 1.5?
Hello,
I have to include a plugin inside a component. Please help me on how to do this?
I have "locator" component and want to include "Extra Vote" plugin inside it. How can I do this?
Thanks
I have to include a plugin inside a component. Please help me on how to do this?
I have "locator" component and want to include "Extra Vote" plugin inside it. How can I do this?
Thanks
- ursitesion
- Joomla! Apprentice
- Posts: 32
- Joined: Tue Aug 10, 2010 12:52 pm
- Location: Delhi, India
- Contact:
Re: How to call plugin inside component for joomla 1.5?
Hi neha2786, its easy to call a plugin within third party extension. I have included "ExtraVote" plugin in my own component beside content. Following is the way to include "ExtraVote" plugin :
global $mainframe;
include_once('components/com_content/models/article.php');
include_once('components/com_content/helpers/query.php');
$dispatcher =& JDispatcher::getInstance();
$articleObject=new ContentModelArticle();
$id= JRequest::getVar('content_id'); // content_id is the id of the content
$limitstart = JRequest::getVar('limitstart', 0, '', 'int'); // for pagination, required for
$articleObject->setId($id);
$item=new JObject;
$item->text = $articleObject->getArticle();
$item->params = clone($mainframe->getParams('com_content'));
JPluginHelper::importPlugin('content'); // very important
$results=$dispatcher->trigger('onBeforeDisplayContent', array (& $item->text, & $item->params, $limitstart));
echo $results[0];
It worked for me. Let me know if any issue you have.
global $mainframe;
include_once('components/com_content/models/article.php');
include_once('components/com_content/helpers/query.php');
$dispatcher =& JDispatcher::getInstance();
$articleObject=new ContentModelArticle();
$id= JRequest::getVar('content_id'); // content_id is the id of the content
$limitstart = JRequest::getVar('limitstart', 0, '', 'int'); // for pagination, required for
$articleObject->setId($id);
$item=new JObject;
$item->text = $articleObject->getArticle();
$item->params = clone($mainframe->getParams('com_content'));
JPluginHelper::importPlugin('content'); // very important
$results=$dispatcher->trigger('onBeforeDisplayContent', array (& $item->text, & $item->params, $limitstart));
echo $results[0];
It worked for me. Let me know if any issue you have.
-
- Joomla! Intern
- Posts: 50
- Joined: Tue Apr 28, 2009 7:37 am
- Location: pune
- Contact:
Re: How to call plugin inside component for joomla 1.5?
Please check this site
http://docs.joomla.org/Supporting_plugi ... _component
http://docs.joomla.org/Supporting_plugi ... _component
Thanks
Kind Regards
Kind Regards
-
- Joomla! Intern
- Posts: 50
- Joined: Tue Apr 28, 2009 7:37 am
- Location: pune
- Contact:
Re: How to call plugin inside component for joomla 1.5?
Instead of calling built-in plugin trigger you can call your own function
for example :-
//here system is plugin group
JPluginHelper::importPlugin( 'system' );
$dispatcher =& JDispatcher::getInstance();
//here intercept_requests is function which is written in side one of the plugin of system group.
$results = $dispatcher->trigger( 'intercept_requests', array(JRequest::get('post')));
working for joomla 2.5 as well
for example :-
//here system is plugin group
JPluginHelper::importPlugin( 'system' );
$dispatcher =& JDispatcher::getInstance();
//here intercept_requests is function which is written in side one of the plugin of system group.
$results = $dispatcher->trigger( 'intercept_requests', array(JRequest::get('post')));
working for joomla 2.5 as well
Thanks
Kind Regards
Kind Regards