Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Meta Module to Load Plugins
Meta Module to Load Plugins
Meta Module to Load Plugins
Is there anyway that the metamodule can be used so that all the plugins loaded by com_content can be loaded in a custom component eg contentprepare etc?
I have tried this sort of thing
Code:
<?php
$text = JHTML::_('content.prepare', $text); // this is a normal one that works
// JPluginHelper::importPlugin('content', 'extravote');
$product_id = '6';
$product_rating = JHTML::_('content.prepare', '{extravote '.$product_id.'}');
?>
<?php echo JHTML::_('content.prepare', '{extravote '.$product_id.'}'); ?>
Code:
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];
All directly in my component.
But the extra vote plugin only works in content. If I load my component inside content using another plugin the plugin works.
Thanks Steve
17-Feb-13 12:01:04
Re: Meta Module to Load Plugins
Hi,
I'm sure that I've managed to load content plugins in custom components before, with not too much trouble. What version of Joomla are you using?
I really don't think you would need to resort to hacks using MetaMod to be able to do this (not that I can think of how you would do that!)
Best regards,
Stephen
- Index
- » MetaMod
- » MetaMod General Support
- » Meta Module to Load Plugins
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Posts this week:
- 2
- User Info:
- Total Users:
- 7628
- Newest User:
- horlogekorting34
- Members Online:
- 0
- Guests Online:
- 159
- Online:
- There are no members online
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked