Page 1 of 2 12 LastLast
Results 1 to 10 of 34

Hybrid View

  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
    64,720
    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.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  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
    64,720
    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.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  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
    64,720
    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.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  7. #7
    Join Date
    Aug 2010
    Posts
    25
    Plugin Contributions
    0

    Default Re: changing the width of my main page

    Hi
    Tried to post in other thread but did not receive any solution.
    I made a fluid site and solved the header fluid issue
    but did not solve the Wide AD Banner ! I want this ad banner
    to be also fluid.
    When large resolution customers enter my site, the banner looks
    very short.
    If I make the file wider, on smaller resolution it makes a mess
    with scorling etc'.
    I am sure that it can be solved and I think fluid site is the more
    proffessional site :)

    my site is adi-beauty (dot) com
    Thanks

  8. #8
    Join Date
    Apr 2011
    Location
    uk
    Posts
    6
    Plugin Contributions
    0

    Default Re: Banners only on main page

    Need help with this too

  9. #9
    Join Date
    Aug 2010
    Posts
    25
    Plugin Contributions
    0

    Default Re: Banners only on main page

    Finally someone with the same problem as mine.
    If you will find a solution please post.

  10. #10
    Join Date
    Nov 2011
    Posts
    2
    Plugin Contributions
    0

    Idea or Suggestion Re: Banners only on main page

    This is how i fixed it:

    In tpl_main_page.php file (line 108), instead of

    <div id="bannerThree" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>

    i have

    <div id="bannerThree" class="banners"><?php if($this_is_home_page) echo zen_display_banner('static', $banner); ?></div>

    That's all, now my banner are showing only on the home page. Hope this will help you!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Banners and Main Page
    By KSource in forum Basic Configuration
    Replies: 2
    Last Post: 26 Mar 2009, 06:20 PM
  2. Multiple Banners on Main page
    By skylab001 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 22 Aug 2008, 06:32 AM
  3. Banners in index main page
    By derer in forum Basic Configuration
    Replies: 5
    Last Post: 15 Nov 2007, 01:09 AM
  4. Showing banners not on the main page?
    By JakubM in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 22 Feb 2007, 08:15 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
  •