Plugins are powerful way of extending the functionality of the Joomla. Plugins provide functions which are associated with trigger events. Joomla has a set of core plugin events. Plugin code is executed when certain events are triggered.
Events or plugins are divided into groups.
A basic Joomla plugin contain following files:
To get started with plugin development, first you need to decide what problem you are trying to solve or what functionality you are trying to implement. Check the Joomla Extension Directory (JED) that a solution to this problem does not already exist.
The next step is to come up with a unique name for this extension. The first part of the name (plg) indicates that this is a plugin extension. Second part identifies what type of plugin this is. Third part is the unique name. For example, plg_content_uniquename
This file is similar to manifest files for other extensions. You have to add the group entry in the <extension> tag and the extended information in the <filename> tag. This information tells Joomla! into which folder to copy the file and to which group the plugin should be added.
In Joomla, all plugins are subclass of JPlugin, a base class that implements the basic properties of plugins. In methods, following properties are available:
// no direct access
defined( '_JEXEC' ) or die;
class Plg<PluginGroup><PluginName> extends JPlugin
* Load the language file on instantiation.
protected $autoloadLanguage = true;
* Plugin method with the same name as the event will be called automatically.
public function <EventName>()
* Plugin code goes here.
* You can access database and application objects and parameters via $this->db,
* $this->app and $this->params respectively
As with all extensions in Joomla, you can install plugins as a .zip file.