<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.sandbox.joomla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kittymcooper</id>
	<title>Joomla! Documentation - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.sandbox.joomla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kittymcooper"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Kittymcooper"/>
	<updated>2026-08-11T13:46:20Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=J3.x:Triggering_content_plugins_in_your_extension&amp;diff=22121</id>
		<title>J3.x:Triggering content plugins in your extension</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=J3.x:Triggering_content_plugins_in_your_extension&amp;diff=22121"/>
		<updated>2010-03-10T05:27:50Z</updated>

		<summary type="html">&lt;p&gt;Kittymcooper: added the exact code to use content plugins&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Development]]&lt;br /&gt;
[[Category:Plugins]]&lt;br /&gt;
&lt;br /&gt;
Using the plugin system in your addon is fairly simple. The most important part is good planning because, to some degree, you&#039;re defining an interface for other people to use.&lt;br /&gt;
&lt;br /&gt;
To activate the plugins for your addon, you just have to use the following  code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$dispatcher =&amp;amp; JDispatcher::getInstance();&lt;br /&gt;
$results = $dispatcher-&amp;gt;trigger(&#039;onSomething&#039;, $params);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This function calls everyplugin that has registered itself for the event &#039;onSomething&#039; and hands over the array $param as parameter. &lt;br /&gt;
&lt;br /&gt;
As a return value you get an array of results from these plugins. All this is of course optional, you could also use the system without parameters and/or a result.&lt;br /&gt;
&lt;br /&gt;
You can also pass arguments by reference to allow plugins to edit the passed data. For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$dispatcher =&amp;amp; JDispatcher::getInstance();&lt;br /&gt;
$dispatcher-&amp;gt;trigger(&#039;onSomething&#039;, &amp;amp;$params);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A common usage might be to use the content plugins if you have an editable field. This is the code that will do that:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
        $dispatcher =&amp;amp; JDispatcher::getInstance();&lt;br /&gt;
        $item-&amp;gt;text = &amp;amp; your_text_area_item;  &lt;br /&gt;
        $item-&amp;gt;params = clone($params);&lt;br /&gt;
        JPluginHelper::importPlugin(&#039;content&#039;); &lt;br /&gt;
        $dispatcher-&amp;gt;trigger(&#039;onPrepareContent&#039;, array (&amp;amp; $item, &amp;amp; $item-&amp;gt;params, 0)); &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You might want to look at core components (for example com_content) for an example.&lt;/div&gt;</summary>
		<author><name>Kittymcooper</name></author>
	</entry>
</feed>