Difference between revisions of "How do you add a new module position?"

From Joomla! Documentation

(Merged with How do you add a position to a template?, changed categories)
m (How do you add a new template position? moved to How do you add a new module position?: These positions are named "module positions" according to the Glossary entry; a template contains a <jdoc:include /> for modules.)
(No difference)

Revision as of 11:41, 22 May 2010

Joomla! 1.5 Joomla 1.5[edit]

The list of available positions where you can insert a module is controlled by the template you are using. It is possible to add new positions to a template. In this example, we will add a new position to the default rhuk_milkyway template. Here are the steps.

  • Open the file "<your Joomla! home>/templates/rhuk_milkyway/index.php" for editing and determine where your new position will be on the page. Note that you can see all of the existing template locations in your browser by adding "?tp=1" to the end of your normal URL (for example, "http://www.yoursite.com/?tp=1").
  • In our example, we will add a new location after the "breadcrumb" position called "mynewposition". To do this, find the line in the file <div id="whitebox"> and insert a new line <jdoc:include type="modules" name="mynewposition" /> as shown below:
<div id="pathway">
   <jdoc:include type="modules" name="breadcrumb" />
</div>
   <div class="clr"></div>
   <div id="whitebox">
      <jdoc:include type="modules" name="mynewposition" />
   <div id="whitebox_t">
  • Open the file "<your Joomla! home>/templates/rhuk_milkyway/templateDetails.xml" for editing and find the "<positions>" section of the file. Add the new entry for "mynewposition" as shown below:
<positions>
   <position>breadcrumb</position>
   <position>left</position>
   <position>right</position>
   <position>top</position>
   <position>user1</position>
   <position>user2</position>
   <position>user3</position>
   <position>user4</position>
   <position>footer</position>
   <position>debug</position>
   <position>syndicate</position>
   <position>mynewposition</position>
</positions>

Now, when you look at your site with the "?tp=1" URL, you should see the new position as shown below:

New template position2.png

In the Module:[Edit] screen, the new position should display in the drop-down list box of available positions, as shown below.

New template position1.png

Joomla! 1.0 Joomla 1.0[edit]

To create a "new" position, choose one of the names from the list of positions shown in Site > Template Manager > Module Positions.