Adding a new module position to the template
Joomla! templates can be divided into areas or positions. These positions are containers where Joomla! will place our modules and components on page load. This way, a Joomla! template knows where to place the component output or where to place the output of a module.
Earlier in this chapter, we saw that these positions are included in the templateDetails.xml
file. Joomla! uses the positions in this manifest file to offer the available positions when editing a module. However, what’s most important is to include the position in the template structure. Template positions are coded in the main file of a Joomla! template, which is the index.php
file of the template. This is where we set up all the HTML basic structures that our template will use to create the output web page.
To make it easier to include Joomla! output content in this template structure, in Joomla!, we can use a custom HTML tag, <
jdoc:include />
.
This tag...