• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 752
  • Last Modified:

How do i insert a module position in joomla?


I am a quick learner and have been using joomla to make pages for some time but have just beginning to change code. I would like to insert a module position into my joomla template. I have added the module value to the best of my knowledge in the templatedetails.xml file and added the code to the index.php fle.

The module i am using is the banner module that will display ads in my website. normally the banner module dispays the banner right at the very bottom of the template on any joomla site. The current banner module position is too low and i wanted to move it up a little in my template. I have set the module position in the module itself to the module i named "ads". (it was set to the default banner position before) I have included some screenshots to give you some idea.. the website is www.treksandtrails.com.au

Any help is appreciated

  templatedetails.xml index.php screenshot
  • 2
  • 2
1 Solution
Once the template is installed you don't need to modify the xml.

Add the template position to the template's index.php file.
<?php if ($this->countModules( 'newmodpos' )) : ?>
<div id="newmodpos"><jdoc:include type="modules" name="newmodpos" style="raw" /></div>
<?php endif; ?>

(also, you would create an appropriate div#newmodpos in css)

Add the template position to the positional dropdown in the module you want to place there.
Despite the fact that the module interface provides a DROPDOWN for its position, it's actually capable of accepting a new value. Enter newmodpos directly into the dropdown value area. See attached.

pcpitstop_auAuthor Commented:
Hi, thank you for your quick reply. That makes a lot of sence and thank you. what do you mean by "(also, you would create an appropriate div#newmodpos in css)"?

Kind Regards,

Ben Waters

In the css folder below index.php, there's probably a file named template_css.css.

You've created a div named newmodpos in your template.

So you can access/decorate it using css by referencing div#newmodpos, which you'd put in template_css.css.

So for instance if you added the code exactly as above to index.php; and published a Custom HTML module to position newmodpos; your html would contain:

<div id="newmodpos">your custom html here</div>

Your css might contain

div#newmodpos {

Which, of course, is silly, but it allows you to see your changes take effect.
pcpitstop_auAuthor Commented:
This Expert should Make Exerts Exchange proud!!

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now