Actions

Difference between revisions of "Module Position"

From Joomla! Documentation

m (added Category:Modules using HotCat)
(18 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{inuse}}
+
{{Chunk:Module Position}}
Module positions are placeholders in a template. They are used to identify positions within the template and to tell the Joomla! application where to place output from modules assigned to a particular position.
+
:[[Image:Module_Map.jpg|600px|Module positions in a default Joomla! 1.5 template]]
 +
==templateDetails.xml==
 +
The <code>templateDetails.xml</code> 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.
 +
<pre>
 +
<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>
 +
</pre>
 +
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 <code><positions></code> and <code></positions></code> tags. In between those tags in the <code>templateDetails.xml</code> file, add the name of the module position in between a set of <code><position></code> and <code></position></code> tags.
  
For example the module position "Left" could be used in the left side of the template to display a site navigation menu.
+
==Use and Implementation==
So if that module is assigned to the "Left" position, it will be displayed there.
+
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]]):
 +
<pre>
 +
<jdoc:include type="modules" name="name of module position" style="xhtml" />
 +
</pre>
  
Ultimately the template designer decides how to use a module position.  Therefore not all templates always support or use all module positions. If a module is assigned to a position that does not exist in a template, then the module will not be displayed. Common module positions are "Left", "Right", "Banner" and "Top".
+
==Visualization==
 +
It's possible to visualize all modules set on a template by calling the <code>"tp=1"</code> query string on the front-end.
 +
<pre>
 +
http://www.yourdomain.com/index.php?tp=1
 +
</pre>
 +
 
 +
The default module positioning looks like the [[Module Map]]
 +
 
 +
<noinclude>[[Category:Templates]]
 +
[[Category:Modules]]
 +
</noinclude>

Revision as of 08:28, 24 June 2013

<translate> A module position is a placeholder in a template. Placeholders identify one or several positions within the template and tell the Joomla! application where to place output from modules assigned to a particular position. The template designer has complete control over module positions, creating variations between templates and the respective Joomla! default positions assigned to modules in the installation sample data.

For example, the module position Left could be defined to be on the left side of the template to display a site navigation menu. So if a module is assigned the Left position, it will be displayed wherever the designer puts that Left module position - not necessarily the left side of the page. </translate>

Module positions in a default Joomla! 1.5 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.

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" />

Visualization

It's possible to visualize all modules set on a template by calling the "tp=1" query string on the front-end.

http://www.yourdomain.com/index.php?tp=1

The default module positioning looks like the Module Map