Actions

Difference between revisions of "Declaring module positions"

From Joomla! Documentation

m (merging in some content)
m (updates)
Line 1: Line 1:
In order for Module positions to be available for selection in the Module Manager they must be declared in the templateDetails.xml file for your template.  The <positions> element in this file contains sub-elements for each Module position that is supported by the template.
+
In order for Module positions to be available for selection in the Module Manager they must be declared in the <code>templateDetails.xml</code> file for your template.  The <code><positions></code> element in this file contains sub-elements for each Module position that is supported by the template.
  
 
===templateDetails.xml===
 
===templateDetails.xml===
Line 27: Line 27:
 
You can add and define new Module positions and give them any name you like, but it is recommended that you support at least those shown in the example above.  This is so that some level of consistency is maintained when switching Templates or using multiple Templates on a single site.
 
You can add and define new Module positions and give them any name you like, but it is recommended that you support at least those shown in the example above.  This is so that some level of consistency is maintained when switching Templates or using multiple Templates on a single site.
  
Further information on placement of the module position in the template file can be found in [[Module positions#Use and Implementation | Use and Implementation]].
 
 
===Use and Implementation===
 
===Use and Implementation===
 
A Joomla! template displays a set of modules added to a specific position using the <code><jdoc:include /></code> statement shown below (for further information about <code><jdoc:include /></code> see [[jdoc statements]]):
 
A Joomla! template displays a set of modules added to a specific position using the <code><jdoc:include /></code> statement shown below (for further information about <code><jdoc:include /></code> see [[jdoc statements]]):

Revision as of 22:29, 29 September 2013

In order for Module positions to be available for selection in the Module Manager they must be declared in the templateDetails.xml file for your template. The <positions> element in this file contains sub-elements for each Module position that is supported by the template.

templateDetails.xml

The templateDetails.xml file contains all the installation and core information for a template, including the module positions it utilizes and displays. Here is a brief list of the commonly used names for the various module positions.

<positions>
  <position>top</position>
  <position>left</position>
  <position>right</position>                
  <position>bottom</position>
  <position>banner</position>
  <position>syndicate</position>
  <position>footer</position>
  <position>user1</position>
  <position>user2</position>
  <position>user3</position>
  <position>user4</position>
  <position>debug</position>
</positions>

Although these are commonly used, it is up to the template developer to choose both a module position name and an accompanying display style.

The addition of module positions, as displayed above, is implemented in between the <positions> and </positions> tags. In between those tags in the templateDetails.xml file, add the name of the module position in between a set of <position> and </position> tags.

You can add and define new Module positions and give them any name you like, but it is recommended that you support at least those shown in the example above. This is so that some level of consistency is maintained when switching Templates or using multiple Templates on a single site.

Use and Implementation

A Joomla! template displays a set of modules added to a specific position using the <jdoc:include /> statement shown below (for further information about <jdoc:include /> see jdoc statements):

<jdoc:include type="modules" name="name of module position" style="xhtml" />