Page 7 of 7 FirstFirst ... 567
Results 61 to 66 of 66
  1. #61
    Join Date
    Oct 2010
    Location
    Idaho
    Posts
    292
    Plugin Contributions
    0

    Default Re: How do i make banner ads appear on the front page only?

    Maybe I'm a moron, but I can't simply get a banner to display at all. The following things are all in place and nothing shows.

    1. My code (below) is from a 12leaves template and it appears in tpl_index_default.php in the centerbox area (just above boxes for New and Featured, etc., and just beneath all header and header navigation code).

    2. In Tools >> Banner Manager, I uploaded an image and put it in a new banner group which I named freeship.

    3. In Config >> Layout Settings, I put the group name 'freeship' in all of the locations to try to get it display, but it doesn't show up anywhere.

    What am I missing?

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

  2. #62
    Join Date
    Oct 2010
    Location
    Idaho
    Posts
    292
    Plugin Contributions
    0

    Default Re: How do i make banner ads appear on the front page only?

    I may have answered my own question.

    I currently have home page opening to top-level cats, so I would need to put the code for <!-- Home page banner 2 --> in tpl_index_categories, not tpl_index_default.

    I suppose that then I could use $this_is_home_page code to only show banner on home page.

  3. #63
    Join Date
    Jan 2006
    Posts
    1,542
    Plugin Contributions
    0

    Default Re: How do i make banner ads appear on the front page only?

    Hi, trying to get a banner to appear on homepage only. Banner group set 4, what we call the footer1 banner immediately under products, etc.

    Solution post 19 did not work. Gives blank page on homepage. Didn't try other pages.

    Link to site:

    http://www.findmypromdress.com/

    Banner currently holds the Youtube link.

    zc 1.3.9h

    Thanks for any help.

    sph
    http://www.prommart.com/
    http://www.fashion-mart.biz/

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

    Default Re: How do i make banner ads appear on the front page only?

    You should be able to use:
    Code:
      if ($this_is_home_page && SHOW_BANNERS_GROUP_SET4 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET4)) {
    If you then are getting a blank page, check that you do not have space(s) or blank line(s) after the closing php ?> at the end of the file ...
    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. #65
    Join Date
    Jan 2006
    Posts
    1,542
    Plugin Contributions
    0

    Default Re: How do i make banner ads appear on the front page only?

    Thanks. I had the code correct. I just discovered that when editing, the code becomes all jumbled-up, causing failure. This often happens lately, with code getting jumbled up when editing. Sometimes it still works; others not.

    sph

  6. #66
    Join Date
    Dec 2008
    Posts
    3
    Plugin Contributions
    0

    Default Re: How do i make banner ads appear on the front page only

    Quote Originally Posted by kuroi View Post
    To hopefully illuminate this issue rather than confuse it. Here is some code that I am currently using to create a banner cluster on the home page of a client's site.

    I have brought together code for the first three banners, simplified it and wrapped a home page condition around it.
    PHP Code:
    <?php
    if ($this_is_home_page) {
      if (
    SHOW_BANNERS_GROUP_SET1 != '' && ($banner zen_banner_exists('dynamic'SHOW_BANNERS_GROUP_SET1)) && $banner->RecordCount() > 0) {
        echo 
    '<div id="bannerOne" class="banners">' zen_display_banner('static'$banner) . '</div>' "\n";
      }
      if (
    SHOW_BANNERS_GROUP_SET2 != '' && ($banner zen_banner_exists('dynamic'SHOW_BANNERS_GROUP_SET2)) && $banner->RecordCount() > 0) {
        echo 
    '<div id="bannerTwo" class="banners">' zen_display_banner('static'$banner) . '</div>' "\n";
      }
      if (
    SHOW_BANNERS_GROUP_SET3 != '' && ($banner zen_banner_exists('dynamic'SHOW_BANNERS_GROUP_SET3)) && $banner->RecordCount() > 0) {
        echo 
    '<div id="bannerThree" class="banners">' zen_display_banner('static'$banner) . '</div>' "\n";
      }
    }
    ?>
    Thanks Kuroi it's working perfect!

 

 
Page 7 of 7 FirstFirst ... 567

Similar Threads

  1. v154 Make Category description only appear on page 1?
    By Feznizzle in forum General Questions
    Replies: 3
    Last Post: 1 Oct 2015, 09:48 PM
  2. Replies: 1
    Last Post: 14 Mar 2012, 03:31 AM
  3. Better arrangement for my 4 Banner Ads at the bottom of Front Page
    By AZUKI in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 20 Nov 2007, 05:09 PM
  4. How do I make my logo only appear on the main page
    By CafePrima in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 27 Oct 2007, 07:00 PM
  5. How do I make the 'Best Sellers' box appear on every page?
    By Winks in forum Basic Configuration
    Replies: 1
    Last Post: 15 Mar 2007, 03:45 PM

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