Page 1 of 4 123 ... LastLast
Results 1 to 10 of 36
  1. #1
    Join Date
    Sep 2009
    Posts
    3
    Plugin Contributions
    0

    Default Banners only on main page

    I am also trying to make the banners only appear on the home page. I tried all of the suggestions offered in the previous posts, and I have not yet had any luck. The website is www.thestorehg.com

    Thanks.

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

    <!--eof banners display-->

    <!--bof- banner #6 display -->
    <?php
    if (SHOW_BANNERS_GROUP_SET6 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET6)) {
    if ($banner->RecordCount() > 0) {
    ?>
    <div id="bannerSix" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
    <?php
    }
    }
    ?>
    <!--eof- banner #6 display -->
    jemilie is offline Reply With Quote

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

    Default Re: Banners only on main page

    You are using:
    $this_is_the_home_page

    try using:
    $this_is_home_page

    There isn't a "the" in there ...
    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
    Sep 2009
    Posts
    3
    Plugin Contributions
    0

    Default Re: Banners only on main page

    Thanks for catching the fact that I needed to remove 'the' from the code.

    I have removed that, and continue to have no luck displaying the banners only on the home page.

    So, I am looking at the name in the code:


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

    <!--eof banners display-->

    I am looking at the names of my groups in the zen cart admin area, and this is what I see:

    The names of my banners groups are header-banner, header-banner2, header-banner3 and header-banner4. The name of the div is BannerOne for all 4 banners when I look at the source code. If this is the case, how should I word my code in the tpl_main_page ?


    Thanks,
    Julia

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

    Default Re: Banners only on main page

    To only show on the home page, try this instead:
    Code:
    if ($this_is_home_page && (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1))) {
    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
    Jul 2009
    Posts
    32
    Plugin Contributions
    0

    Default Re: Banners only on main page

    Quote Originally Posted by Ajeh View Post
    To only show on the home page, try this instead:
    Code:
    if ($this_is_home_page && (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1))) {
    Tried this as well, and am having no luck?

    Entered the code exactly as it was mentioned. Do I need to "name" my banner groups or anything in advance?

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

    Default Re: Banners only on main page

    Check if this is your template ...

    The original file:
    /includes/templates/templates_default/common/tpl_main_page.php

    should be copied (if you already have one, then edit the file rather than copy the file over it) to your templates and overrides directory:
    /includes/templates/your_template_dir/common/tpl_main_page.php

    Make sure that you have defined a Banner for the Banner Group that you have setup in the Configuration ... Layout Settings ...
    Banner Display Groups - Header Position 1
    The Banner Display Groups can be from 1 Banner Group or Multiple Banner Groups

    For Multiple Banner Groups enter the Banner Group Name separated by a colon :

    Example: Wide-Banners:SideBox-Banners

    What Banner Group(s) do you want to use in the Header Position 1?
    Leave blank for none
    And that you have added a Banner to that Banner Group ...
    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
    Apr 2007
    Posts
    42
    Plugin Contributions
    0

    Default Re: Banners only on main page

    I am having the exact same problem. A client wants the banner only on the Main Page, but I'm such a WYSIWYG guy that I can't figure out the code.

    In my case I have assigned Layout Settings/Banner Display Groups - Header Position 2 the value "top-banner". This is what is showing on all pages. So do I modify the tpl_main_page.php in templates/template_default/common, or in the template I am using?

    Do I have to make any modifications to the code provided below?

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

    Is "GROUP_SET1" the same as "Header Position 2" in the Layout Settings?

    I am sooooooooo confused...

    Thanks in advance!

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

    Default Re: Banners only on main page

    Header Position 2 used the code:
    SHOW_BANNERS_GROUP_SET2

    and you appear to be using:
    SHOW_BANNERS_GROUP_SET1
    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 2007
    Posts
    42
    Plugin Contributions
    0

    Default Re: Banners only on main page

    Quote Originally Posted by Ajeh View Post
    Header Position 2 used the code:
    SHOW_BANNERS_GROUP_SET2

    and you appear to be using:
    SHOW_BANNERS_GROUP_SET1
    Thanks. I had copied the code and changed the "1" to "2", with no results. I uploaded the modified file to both the template default and the template I'm using.

    So "GROUP_SET1" the same as "Header Position 2"? Sorry for the lack of understanding, I can usually stumble around through code and eventually get it. Also, in the tpl_main_page.php, there is no GROUP_SET2, the code goes from 1 to 6...

    If it helps at all, we're building the site here:

    http://www.richmondmediatestserver2.info/

    Not much is there yet, just getting attributes and other stuff together right now, so forgive the unfinished state of the site. I have a quick meeting, I'll check back afterwards. Thanks again!

    Doug

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

    Default Re: Banners only on main page

    Do not change the code from 1 to 2 ...

    Find the original code that uses:
    SHOW_BANNERS_GROUP_SET2

    and add your change to that so you are altering the Header Position 2 banner code and not the Header Position 1 banner code ...
    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!

 

 
Page 1 of 4 123 ... LastLast

Similar Threads

  1. Restoring banners on main page
    By shipmodeler in forum General Questions
    Replies: 1
    Last Post: 2 Feb 2016, 01:20 AM
  2. Banners on main landing page
    By madli in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 17 Aug 2010, 04:40 PM
  3. Display banners on main page only?
    By micadelic in forum Basic Configuration
    Replies: 2
    Last Post: 29 Jul 2009, 04:08 PM
  4. Banners and Main Page
    By KSource in forum Basic Configuration
    Replies: 2
    Last Post: 26 Mar 2009, 06:20 PM
  5. Only Show Wide-Banners On Main Page?
    By BarryLegal in forum Basic Configuration
    Replies: 0
    Last Post: 27 Jun 2008, 11: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