Adding a Module Position in a Joomla 1.5 Template

Adding a module position in a Joomla 1.5 template is not as easy as it was in the 1.0 templates. It is a two step process:

1. Add code to template PHP file.

For example, this would go in the index.php file in the template folder – or if you are adding it in an include file.

1
2
3
4
5
<?php if ($this->countModules('user6')) : ?>
    <div>
        <jdoc:include type="modules" name="user6" style="xhtml" />
    </div>
<?php endif; ?>

2. Add module name to templateDetails.xml

You then need to tell Joomla which module positions are available in this template. If you don’t do this step, then Joomla will not present the module position when giving you the option of where to place a module.

templateDetails.xml is in XML format. Within the

1
<install>

namespace, add this:

1
2
3
<positions>
      <position>user6</position>
</positions>

If you already have positions listed, just add the

1
<position>user6</position>

part along with the rest of them.

Join RSS Readers other readers by subscribing to my RSS feed! RSS Logo

Share on Twitter Save to Delicious Stumbleupon Share on Facebook Reddit Other services
Short URL: http://sysbash.com/2q
Last updated: September 27th, 2008
 
  • Paul

    Thanks!! Easy-peezy.

  • Paul

    Thanks!! Easy-peezy.

  • Sumitgupta

    Easy Use to Module in joomla

  • http://www.quantum-coders.com/joomla-development Joomla Programmer

    Thanks for the information.

  • Dana

    Okay, so to add a new module position, the files are going to be edited are: (1) template’s index.php, (2) templateDetail.xml, and (3)? Could #3 be template.css?

  • Cath

    Thanks so much, I’ve been looking for this for a long time!
    much much appreciate! :)