Page 1 of 7 123 ... LastLast
Results 1 to 10 of 66
  1. #1
    Join Date
    Jul 2007
    Posts
    17
    Plugin Contributions
    0

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

    I want to display banner ads in Header position 3, but i only want to show them on the home page of my website. Is there a simple piece of html code i can insert into the banner ad to hide it on all other pages?

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

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

    No. But if you mean banner set 2 in the header, then you can change this
    if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
    to this
    if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2) && $this_is_home_page) {
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Jul 2007
    Posts
    17
    Plugin Contributions
    0

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

    Thanks for the reply, but it is definately Header position 3 that i want to show on the main page only - any thoughts?

    Thanks in advance

  4. #4
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

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

    Although described as header position 3 in Admin > Configuration > Layout Settings, banner group set3 is actually displayed in the center panel. You can make this for the home page only by making a similar change to that explained above in your tpl_main_page.php.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  5. #5
    Join Date
    Jul 2007
    Posts
    17
    Plugin Contributions
    0

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

    I will definately try this, but can you please advise exactly what i need to change to achieve hiding banner set 3 on the main page - i have copied the text below from the tpl_main_page.php file, forgive my lack of knowledge, i m still in the process of learning about all this stuff

    Many Thanks in advance



    // the following IF statement can be duplicated/modified as needed to set additional flags
    if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes _on_here,separated_by_commas,and_no_spaces')) ) {
    $flag_disable_right = true;
    }


    $header_template = 'tpl_header.php';
    $footer_template = 'tpl_footer.php';
    $left_column_file = 'column_left.php';
    $right_column_file = 'column_right.php';
    $body_id = ($this_is_main_page) ? 'indexHome' : str_replace('_', '', $_GET['main_page']);
    ?>
    >
    RecordCount() > 0) {
    ?>




    get_template_dir('tpl_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header.php');?>

    trail(BREAD_CRUMBS_SEPARATOR); ?>RecordCount() > 0) { ?> size('upload') > 0) echo $messageStack->output('upload'); ?> RecordCount() > 0) { ?>

    get_template_dir('tpl_footer.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_footer.php');?>

  6. #6
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

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

    In default Zen Cart you would find the line in your tpl_main_page.php that is identical to the line to which I referred in my original post, except for referring to SET3 instead of SET2 and make the change that I recommended.

    However, this line is not amongst the sample that your posted from your tpl_main_page.php file. This could mean that you haven't posted it all (it does look rather sparse) or that you are using a template whose author has removed it. Are you displaying this banner now?
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  7. #7
    Join Date
    Jul 2007
    Posts
    17
    Plugin Contributions
    0

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

    I don't have the banner that i want to display displaying right now, but i can make banners appear in the Header position 3, i agree that this looks sparse, it is possible that this file has been edited by the developers of the original template, as i have found many instances where this is the case.

    can i add the text you refer to in your original reply?

    or is it possible i have more than one file named tpl_main_page.php?

    what file path should it be under?

  8. #8
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

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

    If you can make banners appear, then the code must be there. We're getting into territory now, where it would be easier to help you if I could see your site. Do you have a link to it?
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  9. #9
    Join Date
    Jul 2007
    Posts
    17
    Plugin Contributions
    0

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

    My mistake, for some reason my FTP program wasn't opening the file correctly, but i have resolved this and added the modifications as you suggested to the SET3 line, however i now have this error

    Fatal error: Call to a member function on a non-object in /home/jane776/public_html/shop/includes/templates/template_default/common/tpl_main_page.php on line 102

    Any ideas?

  10. #10
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

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

    A couple of things here. You shouldn't be making changes to the template_default files. You should only change your over-ride copy of them. I recommend reading up on over-rides in the FAQ.

    Then onto why this isn't working and you are getting an error ... it does seem that there is a problem with either your version of Zen Cart not being up to date, or your template not supporting all Zen Cart functions. This is not easy to establish without more information about both and ideally seeing your site as well.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

 

 
Page 1 of 7 123 ... LastLast

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