Forums / Templates, Stylesheets, Page Layout / Banners: How can I show them on all pages EXCEPT home?

Banners: How can I show them on all pages EXCEPT home?

Started by artjewl on 15 Mar 2011, 2:20 PM · Views: 1,939

Results 1 to 10 of 10
15 Mar 2011, 2:20 PM
#1
artjewl avatar

artjewl

New Zenner

Join Date:
Oct 2010
Posts:
21
Plugin Contributions:
0

Banners: How can I show them on all pages EXCEPT home?

I am trying to hide my "Wide-Banners" from my index/home page, but I need them to still show on all other pages.

How can I do this?

Thanks in advance!

15 Mar 2011, 2:24 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Banners: How can I show them on all pages EXCEPT home?

You can find the banner code you want to control and use something like:

if (!this_is_home_page) {
// do banner code here
}

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!

16 Mar 2011, 6:53 PM
#3
artjewl avatar

artjewl

New Zenner

Join Date:
Oct 2010
Posts:
21
Plugin Contributions:
0

Re: Banners: How can I show them on all pages EXCEPT home?

Ok, so I think I need you to be a little more literal with me. :blush:

I how do I determine what to put in for "this_is_home_page"?

I made the attempt, but all I managed to do was hide the banner on all pages again.

Thanks for your help and patience.

16 Mar 2011, 7:10 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Banners: How can I show them on all pages EXCEPT home?

$this_is_home_page is an existing variable that when on the Home Page would be true and when NOT on the Home Page would be false ...

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!

16 Mar 2011, 7:38 PM
#5
artjewl avatar

artjewl

New Zenner

Join Date:
Oct 2010
Posts:
21
Plugin Contributions:
0

Re: Banners: How can I show them on all pages EXCEPT home?

Ok, so what am I doing wrong...?

In tpl_main_page.php I changed...

<?php 
  if (SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3)) {
    if ($banner->RecordCount() > 0) {
?>
<div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
    }
  }
?>

to

<?php 
  if (SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3) && !this_is_home_page) {
    if ($banner->RecordCount() > 0) {
?>
<div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
    }
  }
?>

Like I said, that removes the banner from ALL pages. (I also tried wrapping the existing if in the new one, but I got the same result.)

16 Mar 2011, 7:56 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Banners: How can I show them on all pages EXCEPT home?

Could you try that with the full variable:
$this_is_home_page

rather than just:
this_is_home_page

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!

18 Mar 2011, 2:08 AM
#7
artjewl avatar

artjewl

New Zenner

Join Date:
Oct 2010
Posts:
21
Plugin Contributions:
0

Re: Banners: How can I show them on all pages EXCEPT home?

Thank you. :) That did the trick.

Thanks for your help and patience!

(I'm learning...)

18 Mar 2011, 12:54 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Banners: How can I show them on all pages EXCEPT home?

You are most welcome ... thanks for the update that you have this working now for the home page by using the correct disgnation for the variable to identify the Home Page with:
$this_is_home_page

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 Apr 2012, 1:59 PM
#9
sahelsteve avatar

sahelsteve

New Zenner

Join Date:
Apr 2012
Posts:
2
Plugin Contributions:
0

Re: Banners: How can I show them on all pages EXCEPT home?

I have the same question, but my banner is in a left side column. I can't see anything in tpl_main_page which relates to this. Can you help?

http://www.jamshop.org.uk

4 Apr 2012, 2:04 PM
#10
ajeh avatar

ajeh

Oba-san

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

Re: Banners: How can I show them on all pages EXCEPT home?

If you did not want to show the Banner box on the Main Page for the:
/includes/modules/sideboxes/banner_box.php

you can copy that to your templates and overrides and use the code in RED to turn it off on the Main Page:

// test if box should display
  $show_banner_box = true;
  if ($this_is_home_page  || SHOW_BANNERS_GROUP_SET7 == '') {
    $show_banner_box = false;
  }

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!