Difference between revisions of "Manifest files"

From Joomla! Documentation

m (Fixed mistake)
(Added links)
Line 134: Line 134:
 
A '''script file''' (PHP code that is run before, during and/or after installation, uninstallation and upgrading) can be defined using a <code><scriptfile></code> element.
 
A '''script file''' (PHP code that is run before, during and/or after installation, uninstallation and upgrading) can be defined using a <code><scriptfile></code> element.
  
== Example ==
+
== Examples ==
See [http://joomlacode.org/gf/project/joomla/scmsvn/?action=browse&path=%2Fdevelopment%2Ftags%2F1.6.x%2F1.6.3%2Fadministrator%2Fcomponents%2Fcom_banners%2Fbanners.xml&revision=21172&view=markup the manifest of the Banner component in version 1.6.3].
+
For a real-life example, see [http://joomlacode.org/gf/project/joomla/scmsvn/?action=browse&path=%2Fdevelopment%2Ftags%2F1.6.x%2F1.6.5%2Fadministrator%2Fcomponents%2Fcom_banners%2Fbanners.xml&view=markup the manifest of the Banner component in version 1.6.5].
 +
 
 +
The Joomla testing process uses several extensions to test whether the installer works correctly. The latest versions of the manifests of these extensions are:
 +
 
 +
* [http://svn.joomla.org/project/cms/development/trunk/tests/_data/installer_packages/com_alpha/alpha.xml com_alpha manifest]
 +
* [http://svn.joomla.org/project/cms/development/trunk/tests/_data/installer_packages/mod_alpha/mod_alpha.xml mod_alpha manifest]
 +
* [http://svn.joomla.org/project/cms/development/trunk/tests/_data/installer_packages/plg_system_alpha/alpha.xml plg_system_alpha manifest]
 +
* [http://svn.joomla.org/project/cms/development/trunk/tests/_data/installer_packages/tpl_simple/templateDetails.xml tpl_simple manifest]
 +
* [http://svn.joomla.org/project/cms/development/trunk/tests/_data/installer_packages/lng_xx-XX/xx-XX.xml lng_xx-XX manifest]
  
 
== Contributors ==
 
== Contributors ==

Revision as of 05:48, 12 July 2011

Quill icon.png
Content is Incomplete

This article or section is incomplete, which means it may be lacking information. You are welcome to assist in its completion by editing it as well. If this article or section has not been edited in several days, please consider helping complete the content.
This article was last edited by Mvangeest (talk| contribs) 12 years ago. (Purge)

Quill icon.png
Page Actively Being Edited!

This article is actively undergoing a major edit for a short while.
As a courtesy, please do not edit this page while this message is displayed. The user who added this notice will be listed in the page history. This message is intended to help reduce edit conflicts; please remove it between editing sessions to allow others to edit the page. If this page has not been edited for several hours, please remove this template, or replace it with {{underconstruction}} or {{incomplete}}.

Introduction[edit]

Within Joomla there are manifest files for all of the extensions. These files include the general installation information as well as parameters for the configuration of the extension itself. Since Joomla! 1.6 Joomla 1.6, there are very few differences between the manifest file formats for the different types of extensions, allowing each type to access the full power of the Joomla! installer.

Naming conventions[edit]

The file must be named manifest.xml or <extension_name>.xml and located in the root directory of the installation package.

Syntax[edit]

Root element[edit]

The primary tag of the installation file is:

<extension></extension>

This starting and closing tags are now valid for all extensions. The new tag <extension> replaces the old <install></install> from Joomla Joomla 1.5. The following attributes are allowed within the tag:

Attribute Values Description
type component
module
plugin
template
This attribute describes the type of the extension for the installer. Based on this type further requirements to sub-tags apply.
version 1.6 String that identifies the version of Joomla for which this extension is developed. For Joomla 1.6 a version higher than 1.5 is required.
method new
upgrade
The default value install will be also used if the method attribute is not used. In these cases the installer will gracefully stop if he finds any existing file/folder of the new extension
client site
administrator
Applicable for modules The client allows to specify for which application client the new module is available.
group <free name> Applicable for plugins The group name specifies for which group of plugins the new plugin is available. The existing groups are the folder names within the directory /plugins. The installer will create new folder names for group names that do not exist yet.

Metadata[edit]

The following elements can be used to insert metadata. None of these elements are required; if they are present, they must be a child of the root element.

  • <name> – raw component name (e.g. com_banners)
  • <author> – author's name (e.g. Joomla! Project)
  • <creationDate> – date of creation or release (e.g. April 2006)
  • <copyright> – a copyright statement (e.g. (C) 2005 - 2011 Open Source Matters. All rights reserved.)
  • <license> – a license statement (e.g. NU General Public License version 2 or later; see LICENSE.txt)
  • <authorEmail> – author's email address (e.g. admin@joomla.org)
  • <authorUrl> – URL to the author's website (e.g. www.joomla.org)
  • <version> – the version number of the extension (e.g. 1.6.0)
  • <description> – the description of the component. This is a translatable field. (e.g. COM_BANNERS_XML_DESCRIPTION)

Front-end files[edit]

    <files folder="from-folder">
        <filename>example.php</filename>
        <folder>examples</folder>
    </files>

Files to copy to the front-end directory should be placed in the <files> element. You can use the optional folder attribute to specify a directory in the ZIP package to copy from. Each file to copy must be represented by a <filename> element. If you want to copy an entire folder at once, you can define it as a <folder>.

Administration section[edit]

    <administration>

The administration section is defined in the <administration> element. Since only components apply to both the site and the administrator, only component manifests can include this element.

Back-end files[edit]

Files to copy to the back-end directory should be placed in the <files> element under the <administration>. You can use the optional folder attribute to specify a directory in the ZIP package to copy from. See Front-end files for further rules.

Menu links and submenus[edit]

        <menu>Example Menu Item Text</menu>
        <submenu>
            <menu link="anoption=avalue">Example Submenu Item Text</menu>
        </submenu>

The text for the main menu item for the component is defined in the <menu> item, a child of <administration>. A <submenu> element may also be present (also a child of <administration>), which may contain more menu items defined by <menu>.

Additionally, each <menu> item can define the following attributes:

Attribute Description
link A link to send the user to when the menu item is clicked
view
img The (relative) path to an image (16x16 pixels) to appear beside the menu item
alt

Configuration[edit]

The <config> element, a child of the root, describes the configuration options for the extension. If applicable, the options will be shown by the appropriate Manager (Plugin Manager, Module Manager or Template Manager). Configuration options can also be defined in a separate file named config.xml. Its root element should be <config>.


Quill icon.png
Content is Incomplete

This article or section is incomplete, which means it may be lacking information. You are welcome to assist in its completion by editing it as well. If this article or section has not been edited in several days, please consider helping complete the content.
This article was last edited by Mvangeest (talk| contribs) 12 years ago. (Purge)

<translate> Joomla! Joomla 2.5 and newer supply the JForm class to conveniently and flexibly create forms with a large amount of form fields. JForm can create forms from XML form definitions. These can be standalone files or sections of other files, notably manifest files.</translate>

<translate>== Syntax == </translate>

<translate> The root element for JForm definitions is usually <config>. <onlyinclude>Under the <config> element, one or more <fieldset> elements may appear, each representing a HTML <fieldset>, a group of form fields visually grouped together. The optional name attribute can be used on the <fieldset> to define the name of the fieldset, as in <fieldset name="params">.</translate>

<translate> Each fieldset must contain one or more <field> elements, each representing a single form field with a label. See Standard form field types for a list of allowed form field types and example XML form field definitions.</translate>


SQL[edit]

    <install>
        <sql>
            <file driver="mysql" charset="utf8">example.install.sql</file>
        </sql>
    </install>
    <uninstall>
        <sql>
            <file driver="mysql" charset="utf8">example.uninstall.sql</file>
        </sql>
    </uninstall>

You can execute SQL during installation and/or uninstallation using the <install> and <uninstall> elements, respectively. An <sql> element should appear as a child of these elements. <sql> can contain any number of <file> elements, each defining a single SQL file to execute. Their database driver types are described by the driver attribute, their character sets by the charset attribute.

Script file[edit]

    <scriptfile>example.script.php</scriptfile>

A script file (PHP code that is run before, during and/or after installation, uninstallation and upgrading) can be defined using a <scriptfile> element.

Examples[edit]

For a real-life example, see the manifest of the Banner component in version 1.6.5.

The Joomla testing process uses several extensions to test whether the installer works correctly. The latest versions of the manifests of these extensions are:

Contributors[edit]