Forums / Basic Configuration / How To Add more banner display groups?

How To Add more banner display groups?

Locked

Views: 18,959

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
18 Aug 2006, 2:48 PM
#1
cuda avatar

cuda

Zen Follower

Join Date:
Jul 2006
Posts:
119
Plugin Contributions:
0

How To Add more banner display groups?

I was looking for a way to add more banner display groups to my clients shop so I could track clicks on home page banners that are the main focus of the home page. While looking around the forums I could not find any info on how to do this so I am sharing my sollution here.

By default there are 9 display groups:

SHOW_BANNERS_GROUP_SET1
...
...
SHOW_BANNERS_GROUP_SET8
&
SHOW_BANNERS_GROUP_SET_ALL
  1. Now how many new Banner display groups do you want? This is how many inserts you will need to make into your 'configuration' table.

  2. Open up your database admin.

  3. Insert your new banner display groups into the 'configuration' table, set values as follows (all blanks will be auto filled no need to enter a value:

configuration_id:
configuration_title: Banner Display Groups - 'New Group Name'
configuration_key: SHOW_BANNERS_GROUP_SET9  (The next set would be 10 and so on for each new group you add)
configuration_value: 	'you will be able to set this is admin just like other banner groups'
configuration_description:  	The Banner Display Groups can be from 1 Banner Gro... (you can copy this from an existing banner group not vital for it to work)
configuration_group_id: 19 (this may be different for some see other groups it should be the same) 	
sort_order: 75 (I started with 75 and went up from there this could be changed)
last_modified: 	
date_added: 	
use_function: 	
set_function:

You have now added xx number of new banner group sets good job.

  1. In the admin go to configuration -> Layout Settings. You will now see your new banner display groups here and you can set the banner display groups just as you would with the preinstalled groups. Add your banners in Tools -> Banner Manager just as you normaly would.

  2. Now to add the banners to your template you must enter this code in your template where you want each group displayed.

 
<?php
//You will have to change 'SHOW_BANNERS_GROUP_SET9' for each different group you added to display the proper banners
if (SHOW_BANNERS_GROUP_SET9 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET9)) 
	{
	if ($banner->RecordCount() > 0) 
		{
       	echo zen_display_banner('static', $banner);
        }
	}?>
  1. Your banners are now placed and you can track their performance.

See how I implemented it on http://www.aikenskincare.us. All of the main home page images are banners so I can track which ones users click on, very useful.

Hope this helps some people.


Barracuda Productions pure instincts

19 Aug 2006, 3:36 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: How To Add more banner display groups?

NOTE: be careful on the use of the directory /banners for your images ...

Some popup blockers such as Norton Security etc. can block these banners based on the path to the images ...

This is always something to check on your site to ensure half your site isn't shut off when utilizing banners ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

19 Aug 2006, 1:37 PM
#3
cuda avatar

cuda

Zen Follower

Join Date:
Jul 2006
Posts:
119
Plugin Contributions:
0

Re: How To Add more banner display groups?

Thank you I had no idea some security software would block a certian directory. This is even true when they are not pop-ups?


Barracuda Productions pure instincts

19 Aug 2006, 2:09 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: How To Add more banner display groups?

Depends on the configuation of the security software ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

4 May 2008, 3:37 PM
#5
fbroz avatar

fbroz

New Zenner

Join Date:
Mar 2008
Posts:
35
Plugin Contributions:
1

Re: How To Add more banner display groups?

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!)

	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:

	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:

<?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!)

        /* 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

6 May 2008, 2:46 PM
#6
cuda avatar

cuda

Zen Follower

Join Date:
Jul 2006
Posts:
119
Plugin Contributions:
0

Re: How To Add more banner display groups?

Thanks fbroz for your extra details I have found using banners to be a very effective inner site marketing tool and much easier to manage changes on the home page....

cheers


Barracuda Productions pure instincts

14 Jun 2008, 11:04 AM
#7
alex123 avatar

alex123

New Zenner

Join Date:
Jul 2006
Posts:
43
Plugin Contributions:
0

Re: How To Add more banner display groups?

Hi Cuba,

Your solution is perfect.

One thing I have trouble with, is to make the "new banner group" display on the left column.

Could you please help me understand where I should place it inside the "tpl_main_page.php" in order to appear on the left side column ?

Thank you for a great contribution.

16 Jun 2008, 7:26 PM
#8
cuda avatar

cuda

Zen Follower

Join Date:
Jul 2006
Posts:
119
Plugin Contributions:
0

Re: How To Add more banner display groups?

Alex123:

Hi Cuba,

Your solution is perfect.

One thing I have trouble with, is to make the "new banner group" display on the left column.

Could you please help me understand where I should place it inside the "tpl_main_page.php" in order to appear on the left side column ?

Thank you for a great contribution.

First it's Cu'd'a :smile: not CU'B'A the country or Gooding Jr......

To add a new banner group in your main template to a side column you need to just insert something like this in your columns where you would like it to appear:

if (SHOW_BANNERS_GROUP_SET10 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET10)) 
	{
	if ($banner->RecordCount() > 0) 
		{
       	echo zen_display_banner('static', $banner);
        }
	}

and change the "SET10" to the correct number.
or you could create a new sidebox, there are many explanations of this look here at the wiki:

http://www.zen-cart.com/wiki/index.php/Tutorial

Hope that helps
Cuda


Barracuda Productions pure instincts

17 Jun 2008, 6:14 AM
#9
alex123 avatar

alex123

New Zenner

Join Date:
Jul 2006
Posts:
43
Plugin Contributions:
0

Re: How To Add more banner display groups?

Sorry Cuda for changing your name :oops:

Thank you for the explanation, its a great contibution :clap:

17 Jun 2008, 1:14 PM
#10
cuda avatar

cuda

Zen Follower

Join Date:
Jul 2006
Posts:
119
Plugin Contributions:
0

Re: How To Add more banner display groups?

No worries actually gave me a laugh :laugh:....Glad this was helpful for you. If you have any insight or tricks that helped you with this post them here to help others


Barracuda Productions pure instincts

9 Jan 2009, 4:20 PM
#11
helpme avatar

helpme

Totally Zenned

Join Date:
Apr 2007
Posts:
632
Plugin Contributions:
0

Re: How To Add more banner display groups?

This has been very helpful....my final problem is I can not for the life of me get it to go where I want it to!!!! I have worked in tpl_mainpage A LOT and I can get it to show up, but not where I want.
this is the site: squishy tushy .com and I want it under the Rate Us sidebox on the left OR on the bottom right under the testimonials. I can get it to show up at the top of either column I can't move it down.

Thanks for any help!

11 Apr 2009, 4:07 PM
#12
george_susini avatar

george_susini

New Zenner

Join Date:
Mar 2009
Location:
Raleigh, NC
Posts:
31
Plugin Contributions:
0

Re: How To Add more banner display groups?

How would I apply a new banner group to the specials page, I tried this to supress the banner group 1 on the specials page but it is not working

if (SHOW_BANNERS_GROUP_SET1 != '' && $_GET['main_page'] != 'specials' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) {
if ($banner->RecordCount() > 0) {
?>

George Susini Raleigh Tech Consulting - Raleigh, NC

11 Nov 2010, 3:54 PM
#13
rdarko avatar

rdarko

New Zenner

Join Date:
Nov 2010
Posts:
1
Plugin Contributions:
0

Re: How To Add more banner display groups?

Thanks so much for this. i have been looking everywhere for this! :-D