Results 1 to 10 of 10
  1. #1
    Join Date
    Oct 2010
    Posts
    21
    Plugin Contributions
    0

    help question 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!

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default 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:

    Code:
    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: v1.5.5]
    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!

  3. #3
    Join Date
    Oct 2010
    Posts
    21
    Plugin Contributions
    0

    Default 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.

    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.

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default 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: v1.5.5]
    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!

  5. #5
    Join Date
    Oct 2010
    Posts
    21
    Plugin Contributions
    0

    Default 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...
    Code:
    <?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

    Code:
    <?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.)

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default 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: v1.5.5]
    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!

  7. #7
    Join Date
    Oct 2010
    Posts
    21
    Plugin Contributions
    0

    Default 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...)

  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default 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: v1.5.5]
    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!

  9. #9
    Join Date
    Apr 2012
    Posts
    2
    Plugin Contributions
    0

    Default 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

  10. #10
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default 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:
    Code:
    // 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: v1.5.5]
    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!

 

 

Similar Threads

  1. v151 Banners show in all pages, except for product pages. Help!
    By AquaticAddiction in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 6 Mar 2014, 05:56 PM
  2. Disable Footer Banner all pages except Home
    By kburner in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 5
    Last Post: 27 Dec 2010, 08:39 PM
  3. Replies: 0
    Last Post: 12 Feb 2010, 07:10 PM
  4. How can I force ALL of my admin pages to show in SSL?
    By matsounds in forum Basic Configuration
    Replies: 7
    Last Post: 31 Jul 2009, 01:06 AM
  5. Replies: 3
    Last Post: 20 Mar 2009, 06:11 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR