Adding Module Positions

Everything to do with Joomla! 1.5 templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Locked
pukleturkle
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed Mar 03, 2010 12:44 pm

Adding Module Positions

Post by pukleturkle » Wed Mar 03, 2010 1:07 pm

Hi hope someone can help.

Template: siteground-j15-47
Joomla: 1.5

I am using mod_jsn_imageshow_pro on my website http://www.agileict.co.uk.

I was having issues with the module in the way that I had linked it to user3 position. It was not showing on ie7 but did on ie8 and Firefox. I had it attached the module to user3 (top menu) so it was sitting just below it which was less than ideal anyway.

Today using information from the web I have added these additional positions...

Code: Select all

<position>user1</position>
<position>user2</position>
<position>user4</position>
<position>user5</position>
<position>user6</position>
...into the templates.php. Then I have added this code into the index.php.

Code: Select all

						
<!-- BEGIN: banner:user6 -->
<div id="user6"> 
<div class="user6-class">
<table cellspacing="0" cellpadding="0" style="width: 900px; height: 210px; text-align: center; margin: 0 auto;">
<tr><td style="text-align: center; vertical-align: middle;">
<jdoc:include type="modules" name="user6" />
<tr><td>
</table>
</div>    
I would really like it if I could have this scrolling banner at a reduce size (w480 x h150) so that it sits between the left and right menus. The reason I want to do this is that I only want the scrolling banner on the homepage and not on all the other pages. The way I have done it currently only lets me have it on all pages, otherwise I end up with a big gap where user6 is defined on all the other pages.

I have a very basic understanding of the code. I presume I need to place this code at a different position in the index.php or within a table but I am not sure how. Any help would be appreciated.

Steve

User avatar
michael_king
Joomla! Intern
Joomla! Intern
Posts: 69
Joined: Mon Jul 28, 2008 3:31 am

Re: Adding Module Positions

Post by michael_king » Wed Mar 03, 2010 1:39 pm

If you wanted to keep the banner on your homepage but avoid having a gap on other pages you could wrap the section with some php code that would check to see if any modules were published on the current page and the only render the div tags for the user6 area if you had modules assigned to the area. The code would look something like this:

Code: Select all

<?php if($this->countModules('user6')) : ?>
<!-- BEGIN: banner:user6 -->
<div id="user6"> 
<div class="user6-class">
<table cellspacing="0" cellpadding="0" style="width: 900px; height: 210px; text-align: center; margin: 0 auto;">
<tr><td style="text-align: center; vertical-align: middle;">
<jdoc:include type="modules" name="user6" />
<tr><td>
</table>
</div>  
<?php endif; ?>
The of course in the Module Manager page for mod_jsn_imageshow_pro you would publish the module only on the homepage.

pukleturkle
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed Mar 03, 2010 12:44 pm

Re: Adding Module Positions

Post by pukleturkle » Wed Mar 03, 2010 1:48 pm

Brilliant Michael that works well, thank you so much.

Any ideas on how I can position the banner so that it fits between the left and right columns?

Thanks again

Steve

User avatar
michael_king
Joomla! Intern
Joomla! Intern
Posts: 69
Joined: Mon Jul 28, 2008 3:31 am

Re: Adding Module Positions

Post by michael_king » Thu Mar 04, 2010 1:36 am

From what I can see of your source code it looks like the main section of your page is set up within a division with the id="maincolumn"

Somewhere within your index.php, within that maincolumn division there will be the code

Code: Select all

<jdoc:include type="component" />
. This is the code that will generate the main article for each page.

If I understand what you want to do correctly, you need to place the code for the user6 area within the maincolumn division, and above the code for the component. So you'd have something like:

Code: Select all

<div id="maincolumn">

<?php if($this->countModules('user6')) : ?>
<!-- BEGIN: banner:user6 -->
<div id="user6"> 
<div class="user6-class">
<table cellspacing="0" cellpadding="0" style="width: ....px; height: 210px; text-align: center; margin: 0 auto;">
<tr><td style="text-align: center; vertical-align: middle;">
<jdoc:include type="modules" name="user6" />
<tr><td>
</table>
</div>  
<?php endif; ?>

<jdoc:include type="component" />

</div>
You may also have other stuff within the maincolumn division which I've not considered. You'll want to change the width of the table as well.
All the best with it.

pukleturkle
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed Mar 03, 2010 12:44 pm

Re: Adding Module Positions

Post by pukleturkle » Thu Mar 04, 2010 7:35 pm

Hi Micheal

Thanks again - okay I am kind of getting there now.

If you have a look now I have reduced the size of the mod_jsn_imageshow_pro to 468 x 150 but now what I want is for the Left and right (Products and Newsletters) to sit up level with the banner. I have done a mock up http://www.agileict.co.uk/downloads/mock.jpg

http://www.agileict.co.uk


Locked

Return to “Templates for Joomla! 1.5”