How do i insert a module position in joomla?

Hello.

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
pcpitstop_auAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
joomla_phpCommented:
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.

newmodpos.png
0
 
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

0
 
joomla_phpCommented:
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 {
font-size:24px;
}

Which, of course, is silly, but it allows you to see your changes take effect.
0

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
 
pcpitstop_auAuthor Commented:
This Expert should Make Exerts Exchange proud!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.