Monday, April 4, 2011

Call plugin in third party extension of joomla

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');
        $limitstart    = JRequest::getVar('limitstart', 0, '', 'int');
        $articleObject->setId($id);
        $item=new JObject;
        $item->text = $articleObject->getArticle(); 
        $item->params = clone($mainframe->getParams('com_content'));
        JPluginHelper::importPlugin('content');
        $results=$dispatcher->trigger('onBeforeDisplayContent', array (& $item->text, & $item->params, 0));
        echo $results[0];

2 comments:

  1. where to add this in the component?

    Is this the method to add extravote in the component?

    ReplyDelete
  2. Hello There, Can you please write a few lines about it. Is this work in joomla 2.5 , Where we include this code. into tmpl/default.php ?

    ReplyDelete

Thanks for your valuable comments.

Important queries based formulas to watch performance of a MySQL based application

(1) Session Vs global status variables value select G.variable_name,G.variable_value GlobalValue,S.variable_value SessionValue from (selec...