Module Position: Difference between revisions

From Joomla! Documentation

Tom Hutchison (talk | contribs)
m update to text, needs an update to image
Cmb (talk | contribs)
Clarified Visualization instructions.
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Chunk:Module Position}}
<noinclude><languages /></noinclude>
:[[Image:Module_Map.jpg|600px|Module positions in a default Joomla! 1.5 template]]
<translate>
==templateDetails.xml==
{{Chunk:Module Position/en}}
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.
__TOC__
<pre>
==Understanding Module Positions== <!--T:1-->
<positions>
Joomla! Users and Administrators need to only understand the following:
<position>top</position>
*Modules are set positions dictated by the [[template]] developer.
<position>left</position>
*Modules can be turned on and off based on menu selection.
<position>right</position>
*Modules can be reordered in their assigned position using the Module Manager.
<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.


==Use and Implementation==
===Visualization=== <!--T:2-->
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]]):
It's possible to visualize all modules positions in a template by adding the <code>"tp=1"</code> query string to the URL.
<pre>
<pre>
<jdoc:include type="modules" name="name of module position" style="xhtml" />
https://www.example.com/?tp=1
</pre>
</pre>


==Visualization==
<!--T:3-->
It's possible to visualize all modules set on a template by calling the <code>"tp=1"</code> query string on the front-end.
'''Joomla 2.5''' {{JVer|2.5}}, '''Joomla 3.x''' {{JVer|3.x}} and '''Joomla 4.x''' {{JVer|4.x}} will show the template positions with ?tp=1 or &tp=1 if the '''Preview Module Positions mode''' in the Template Manager has been '''Enabled''':
<pre>
*For Joomla 3 and earlier, {{rarr|Extensions,Templates,Options,Templates tab}}.
http://www.yourdomain.com/index.php?tp=1
*For Joomla 4, {{rarr|System,Site Templates (or Administrator Templates),Options,Templates tab}}.
</pre>
*Set ''Preview Module Positions'' to '''Enabled'''. Then select ''Save & Close''.


The default module positioning looks like the [[Module Map]]
==Module Map== <!--T:4-->
The image below shows a module map when visualization is enabled.
:[[Image:Module_Map.jpg|600px|Module positions in a default Joomla! 1.5 template]]


<noinclude>[[Category:Templates]]</noinclude>
<!--T:5-->
<noinclude>[[Category:Templates]]
[[Category:Modules]]
</noinclude>
</translate>

Latest revision as of 17:29, 13 July 2022

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.

Understanding Module Positions

Joomla! Users and Administrators need to only understand the following:

  • Modules are set positions dictated by the template developer.
  • Modules can be turned on and off based on menu selection.
  • Modules can be reordered in their assigned position using the Module Manager.

Visualization

It's possible to visualize all modules positions in a template by adding the "tp=1" query string to the URL.

https://www.example.com/?tp=1

Joomla 2.5 Joomla 2.5, Joomla 3.x Joomla 3.x and Joomla 4.x Joomla 4.x will show the template positions with ?tp=1 or &tp=1 if the Preview Module Positions mode in the Template Manager has been Enabled:

  • For Joomla 3 and earlier, Extensions  Templates  Options  Templates tab.
  • For Joomla 4, System  Site Templates (or Administrator Templates)  Options  Templates tab.
  • Set Preview Module Positions to Enabled. Then select Save & Close.

Module Map

The image below shows a module map when visualization is enabled.

Module positions in a default Joomla! 1.5 template