How do i insert a module position in joomla?

Posted on 2011-04-20
Last Modified: 2012-05-11

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

Any help is appreciated

  templatedetails.xml index.php screenshot
Question by:pcpitstop_au
    LVL 13

    Expert Comment

    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.


    Author Comment

    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

    LVL 13

    Accepted Solution

    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.

    Author Closing Comment

    This Expert should Make Exerts Exchange proud!!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    CSS3 Custom checkboxes This article shows how to style the checkbox form element using only CSS. Works in: Chrome, FF, Safari, Opera, IE9+ Uses modernizr.js to check for :checked pseudo class, falling back to plain old checkboxes (IE8 and bel…
    Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
    In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now