Zen Cart Logo
Forums / Discounts/Coupons, Gift Certificates, Newsletters, Ads / Disable Footer Banner all pages except Home

Disable Footer Banner all pages except Home

Locked

Views: 1,782

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
27 Dec 2010, 7:24 PM
#1
kburner avatar

kburner

Totally Zenned

Join Date:
Apr 2008
Location:
Flint, Michigan
Posts:
684
Plugin Contributions:
0

Disable Footer Banner all pages except Home

I have been trying to disable the banner for footer on all pages except the home or index page. I do not want it to show anywhere else. But have not been able to do it.

The layout is Banner Display Groups - Footer Position 1 for BannerFour. It is above my actual footer. This is what I input for includes/templates/my_temp/common/tpl_main_page.php.

<?php
 if (SHOW_BANNERS_GROUP_SET4 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET4)) {
  if ($banner->RecordCount() > 0) {
?>
<div id="bannerFour" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
if (SHOW_BANNERS_GROUP_SET4 == '') {
    $show_banner_box = false;
  }
if ($this_is_home_page) {
    $show_featured = true;
  } else {
    $show_featured = false;
  }
    }
  }
?></td>

And still showing up. Any suggestions? Kim

27 Dec 2010, 7:26 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Disable Footer Banner all pages except Home

You are using the wrong variables in your IF statement ... you need to use:
$show_banner_box

and you are using:
$show_featured

27 Dec 2010, 7:30 PM
#3
kburner avatar

kburner

Totally Zenned

Join Date:
Apr 2008
Location:
Flint, Michigan
Posts:
684
Plugin Contributions:
0

Re: Disable Footer Banner all pages except Home

Ajeh:

You are using the wrong variables in your IF statement ... you need to use:
$show_banner_box

and you are using:
$show_featured

I changed it to $show_banner_box and still showing on product pages...

What else am I missing??

Thanks,Kim

27 Dec 2010, 7:34 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Disable Footer Banner all pages except Home

Sorry, I was not paying attention to what you were really trying to do ...

In that file, you only need to change the 1 line:

 if (SHOW_BANNERS_GROUP_SET4 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET4)) {

to read:

 if ($this_is_home_page && SHOW_BANNERS_GROUP_SET4 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET4)) {

adding what is in red will only let the code run if on the Home page ...

27 Dec 2010, 7:39 PM
#5
kburner avatar

kburner

Totally Zenned

Join Date:
Apr 2008
Location:
Flint, Michigan
Posts:
684
Plugin Contributions:
0

Re: Disable Footer Banner all pages except Home

Perfect!
:clap::clap:
Thank you! Kim

27 Dec 2010, 7:39 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Disable Footer Banner all pages except Home

You are most welcome ... thanks for the update that this worked for you ... :smile: