Packaging Custom Work :: The Module Setup File 

{glossarbot=disable}The XML for a Module installation could look like this:

<?xml version="1.0" encoding="iso-8859-1"?>
 <mosinstall type="module" version="1.0">
   <name>A Sample Joomla! Module</name>
   <copyright>(C) 2005 Open Source Matters. All rights reserved.</copyright>
   <license> GNU/GPL</license>
   <description>It displays a menu.</description>
     <filename module="mod_mainmenu">mod_mainmenu.php</filename>
    <param name="menutype" type="text" default="" label="Menu Type"
         description="The name of the menu (default mainmenu)" />
    <param name="class_sfx" type="text" default="" label="Class Suffix"
         description="A suffix to be applied to the CSS class" />
    <param name="menu_style" type="list" default="vert_indent" label="Menu Style"
         description="The menu style">
     <option value="vert_indent">Vertical</option>
     <option value="horiz_flat">Horizontal</option>

There needs to be ONE and only one <filename> that has a "module" attribute.  This attribute is used as a system variable.

A Joomla! Module may optionally have parameters associated with it.  If parameters are supported by the Module then exactly one <params> element should be included containing one <param> sub-element for each parameter to be defined.  Once the Module is installed parameters will be displayed and values may be entered in the Administrator Module Edit form.  If no <params> element is defined (and if this is the case then no <param> elements must be included either) then a simple text box will be provided in the Administrator Module Edit form.

For Administrator Modules you must include a "client" attribute in the <mosinstall> element, for example:

<mosinstall type="module" client="administrator">

Please report any errors on this page to the Developer Documentation Forum.
Last Updated ( Monday, 24 April 2006 )