NYCPHP Meetup

NYPHP.org

[joomla] enabling plugins in extensions

Mark Simko masimko at verizon.net
Thu Apr 22 15:21:46 EDT 2010


Thanks, Gary, that is the awesomest!!!!! You get to wear the wizard cap
today!!!!!!

Mark

==============

That code there is for a find/replace function.

Basically, what happens is when Joomla runs the a plugin, a lot of plugins
will go and check the html that has been generated for the keystring and
then replace everything in the {} with the results of a script.

However, such plugins have to actually be triggered by an event in order to
run.  I'm guessing this is a content plugin?  Content plugins are only run
by the content component and components that have been specifically enabled
in their code to run them.

Here is a good article on various plugin magic and how to work around these
limitations:
http://www.howtojoomla.net/how-tos/development/how-to-fix-joomla-content-plugins

The SHORT summary would be to do the following:

$findSnapshot =
"{product_snapshot:id=$prod_id,showname=n,showprice=n,showdesc=n,showaddtocart=y}";

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

This should trigger the content plugins and generate the html you are
looking for.

-Gary




More information about the Joomla mailing list