Joomla 1.5 center banner modules

A common problem with Joomla 1.5 is centering banners placed in the left or on the right side.
We create a new banner from COMPONENTS -> BANNER , the banner is displayed but never centered.
The solution to this problem is editing the file modules/mod_banners/tmpl/default.php : we need to tell Joomla to center each element.

You must edit this portion of the file

foreach($list as $item) :
?><div class=”banneritem<?php echo $params->get( ‘moduleclass_sfx’ ) ?>”><?php
echo modBannersHelper::renderBanner($params, $item);
?><div class=”clr”></div>
</div>
<?php endforeach; ?>

and we must add the <center> … </center> directive, thus having:

foreach($list as $item) :
?><center><div class=”banneritem<?php echo $params->get( ‘moduleclass_sfx’ ) ?>”><?php
echo modBannersHelper::renderBanner($params, $item);
?><div class=”clr”></div>
</div></center>
<?php endforeach; ?>

Save the file and exit, it should work fine ;)

Tags: , ,

3 Responses to “Joomla 1.5 center banner modules”

  1. the rock123 Says:

    Hello, thanks for the code it works great, but is it possible to make the advertise text centered too ? (the text that is above the banner)

  2. admin Says:

    I guess you can use the same CENTER tag 3 lines before

    Hope it helps!

  3. davs Says:

    THANK YOU VERY MUCH !!

Leave a Reply