Adding a New Module Position in Joomla

Add the following code in the index.php file located in the template folder.

Goto folder templates>"template name" within this folder you will see index.php open in edit

 

Enter the following code:

"<div id="DIVNAME">

<jdoc:include type="modules" name="POSITIONNAME"  Style="xhtml"/>

</div>"

 

in any location within this file. The location of the code determines the location where this module position will appear in your template.

To check goto the home page of your site's home page and in the URL add ?tp=1 to the end

This shows you all of the locations user define and core joomla positions for that template

 

For example if you want to add a new position where the main image appears in your template.

Add the above code just above the image file locations

 

"<img src="/templates/<?php echo $this->template ?>/images/headerphoto.jpg" width="820" height="120" alt="headerphoto" class="no-border" /> "

 

If you want To replace this image location with the new POSITIONNAME then comment the above code by adding ''<!--   -->" between the above code

Once you have done this check the position with ?tp=1

 

You will now need to add the new defined position to the templateDetails.xml file located in the same template folder

 

Goto

"<positions>

<position>breadcrumb</position>

<position>left</position>

<position>right</position>

<position>user1</position>

<position>user2</position>

<position>user3</position>

<position>user4</position>

<position>POSITIONNAME</position>

</positions>"

 

Add the new user defined location as "<position>POSITIONNAME</position>"

You can now see the new position in the administrator panel as POSITIONNAME for any module in the Extensions>module manager.

This post is based on Joomla 1.5


Print   Email

Related Articles