Cuda,
Thanks for your tip, this helped me enormously with adding a cluster of three banners on the main page instead of just one big banner. Since I am still a beginner with zencart and web design, it took me quite a while to figure out how to do this, even with your instructions. I will post the details of my solution just in case it can help someone further:
First, I added the new banner groups to the database as described by Cuda. I use MAMP for development, so I went to the phpMyAdmin page (not part of Zen Cart) and selected my database. I clicked on the Configuration link on at the top.

I inserted the first banner with these values (yours may be different!)
Code:
configuration_id:
configuration_title: Banner Display Groups - 'Top Right Main'
configuration_key: SHOW_BANNERS_TOP_RIGHT_MAIN
configuration_value:
configuration_description: The Banner Display Groups can be from 1 Banner Group or Multiple Banner Groups<br /><br />For Multiple Banner Groups enter the Banner Group Name separated by a colon <strong>:</strong><br /><br />Example: Wide-Banners:SideBox-Banners<br /><br />What Banner Group(s) do you want to use in the Header Position 3?<br />Leave blank for none
configuration_group_id: 19
sort_order: 75
last_modified:
date_added:
use_function:
set_function:
Then I inserted the next banner with very similar values:
Code:
configuration_id:
configuration_title: Banner Display Groups - 'Bottom Right Main'
configuration_key: SHOW_BANNERS_BOTTOM_RIGHT_MAIN
configuration_value:
configuration_description: The Banner Display Groups can be from 1 Banner Group or Multiple Banner Groups<br /><br />For Multiple Banner Groups enter the Banner Group Name separated by a colon <strong>:</strong><br /><br />Example: Wide-Banners:SideBox-Banners<br /><br />What Banner Group(s) do you want to use in the Header Position 3?<br />Leave blank for none
configuration_group_id: 19
sort_order: 85
last_modified:
date_added:
use_function:
set_function:

Next, I modified the /includes/templates/<template name>/common/tpl_main_page.php file to place the new banner groups where I wanted them. My code looked like this:
Code:
<?php
if ($this_is_home_page and SHOW_BANNERS_GROUP_SET3 != '' && ($banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) && ($bannert = zen_banner_exists('dynamic', SHOW_BANNERS_TOP_RIGHT_MAIN)) && ($bannerb = zen_banner_exists('dynamic', SHOW_BANNERS_BOTTOM_RIGHT_MAIN))) {
if ($banner->RecordCount() > 0) {
?>
<!-- my custom banner wrapper -->
<div id="mainBannerWrapper">
<!-- existing template code -->
<div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<!-- wrapper for the two banners on the right -->
<div id="rightBannerWrapper">
<!-- new banner groups -->
<div class="rightBanners"><?php echo zen_display_banner('static', $bannert); ?></div>
<div class="rightBanners"><?php echo zen_display_banner('static', $bannerb); ?></div>
<!-- close rightBannerWrapper-->
</div>
<!-- this fixes layout problems AFTER the banner cluster -->
<div style="clear:both;"></div>
<!-- close mainBannerWrapper -->
</div>
<?php
}
}
?>
I added a wrapper for the whole banner cluster called "mainBannerWrapper"
mainBannerWrapper contains the main banner on the left and another wrapper on the right for the two smaller banners. The main banner on the left is the original bannerThree that Zen Cart originally put in this location. That line is unchanged.
The rightBannerWrapper is something I added to hold the two new banner groups that I added to the database, those get their own divs.
Below that is a "clear: both". without it, the content below this section flys off to the right instead of falling down below.
We still have to edit the css file so that everything gets positioned correctly.
Here are my changes to the css file (Your changes will probably be different!)
Code:
/* Removed #bannerThree from below to remove the padding. */
#bannerOne, #bannerTwo, #bannerFour, #bannerFive, #bannerSix {
padding:.8em;
}
#bannerTRM {
float:top;
}
#bannerBRM {
float:bottom;
}
#rightBannerWrapper {
float:right;
width:180px;
}
#bannerThree {
width:550px;
float:left;
}
#bannerClusterWrapper {
width:730px;
margin:0 auto;
}
Finally, you must also turn on the banners in Layout Manager by adding a banner group to them:
Hope this helps anyone out there adding new banner display groups.
Frank
Bookmarks