Blog!

Read more about Joomla!

How to create a custom module position in Joomla

module-positions-1

Although Joomla themes ships with a handsome number of module positions. If you are developing your own template or need to display a module in a specific position where no default module position exists, Joomla! provides you the power to create a custom module position anywhere in your Joomla template and display your module content. Just hang around and follow the below mention quick steps to create your first custom module position in your Joomla! template.

Let Us Begin

To create a custom module position you need to access two files of your Joomla template 'templateDetails.xml' and 'index.php'.


Open up 'TemplateDetails.xml' in your favorite text editor and locate the <positions></positions> tag. You will find all current module positions that your template supports in a subtag of <position></position>. All you need is to enter a new position name for your module, say, 'custom-position' as shown in the image. Save and close the file.

Now open up your templates 'index.php' file and move to a point where you want your module position to display. Enter the following lines to direct Joomla! CMS to display a module position.

<jdoc:include type="modules" name="custom-position" style="xhtml" />

Note that the name attribute holds the value of module position that you created earlier in 'templateDetails.xml' file. Save and close the 'index.php' file.

Congratulations! You created your first custom module position in your Joomla! template :)

 

stellar-joomla-support

Joomla Upgrade Services and Automated Backups

Joomla Website Performance Optimization

Cron Job Starts