Manifests
Overview
All plugins should include a manifest in the form of an XML document named the
same as the plugin. So, a plugin named test.php
would have an accompanying test.xml
manifest.
Directory & Files
Manifests are stored in the same directory as the plugin file itself and must be named the same (file extension being the obvious exception).
/hubzero /plugins /{PluginType} {PluginName}.php (includes /{PluginName}/{PluginName}.php) {PluginName}.xml /{PluginName}.php (Joomla 1.7+ compatibility) {PluginName}.php (Joomla 1.7+ compatibility) {PluginName}.xml (Joomla 1.7+ compatibility)
Structure
A typical Joomla 1.7+ plugin manifest:
<?xml version="1.0" encoding="utf-8"?> <extension version="1.7" type="plugin" group="system"> <name>System - Test</name> <author>Author</author> <creationDate>Month 2008</creationDate> <copyright>Copyright (C) 2008 Holder. All rights reserved.</copyright> <license>GNU General Public License</license> <authorEmail>email</authorEmail> <authorUrl>url</authorUrl> <version>1.0.1</version> <description>A test system plugin</description> <files> <filename plugin="example">example.php</filename> </files> <config> <fieldset> <field name="example" type="text" default="" label="Example" description="An example text parameter" /> </fieldset> </config> </install>
A typical Joomla 1.5 plugin manifest:
<?xml version="1.0" encoding="utf-8"?> <install version="1.5.2" type="plugin" group="system" method="upgrade"> <name>System - Test</name> <author>Author</author> <creationDate>Month 2008</creationDate> <copyright>Copyright (C) 2008 Holder. All rights reserved.</copyright> <license>GNU General Public License</license> <authorEmail>email</authorEmail> <authorUrl>url</authorUrl> <version>1.0.1</version> <description>A test system plugin</description> <files> <filename plugin="example">example.php</filename> </files> <params> <param name="example" type="text" default="" label="Example" description="An example text parameter" /> </params> </install>
Let's go through some of the most important tags:
- INSTALL/EXTENSION
- This tag has several key attributes. The type must be "plugin" and you must specify the group. The group attribute is required and is the name of the directory you saved your files in (for example, system, content, etc). We use the
method="upgrade"
attribute to allow us to install the extension without uninstalling. In other words, if you are sharing this plugin with other, they can just install the new version over the top of the old one. - NAME
- We usually start the name with the type of plugin this is. Our example is a system plugin and it has some some nebulous test purpose. So we have named the plugin "System - Test". You can name the plugins in any way, but this is a common format.
- FILES
- The files tag includes all of the files that will will be installed with the plugin. Plugins can also support be installed with subdirectories. To specify these just all a FOLDER tag,
<folder>test</folder>
. It is common practice to have only one subdirectory and name it the same as the plugin PHP file (without the extension of course). - PARAMS/CONFIG
- Any number of parameters can be specified for a plugin. Please note there is no "advanced" group for plugins as there is in modules and components.
See Joomla!'s Documentation on the full list of available parameter types and what they do.