Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2007
    Posts
    43
    Plugin Contributions
    0

    Default Change Home Page Content to Banner Manager

    I changed my home page content (as found in html/includes/define_main_page.php) to be a Banner Manager item instead. Why? That way I can automate changes in content by date. I can also track hits if I'm using an image.

    I though I'd post the code, just in case anyone else is interested.

    I switched the "Header Position 3" Banner from being at the top of the page, to being part of the main content.

    1. copy /includes/templates/template_default/common/tpl_main_page.php to your override folder.

    2. comment out the following code, at around line 99

    <?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
    }
    }
    ?>

    3. copy /includes/templates/template_default/templates/tpl_index_default.php to your override folder. Check that it's not already there in case you've already made some changes!

    4. comment out where the home page looks for the define page, at around line 33:
    <?php if (DEFINE_MAIN_PAGE_STATUS >= 1 and DEFINE_MAIN_PAGE_STATUS <= 2) { ?>
    <?php
    /**
    * get the Define Main Page Text
    */
    ?>
    <div id="indexDefaultMainContent" class="content"><?php require($define_page); ?></div>
    <?php } ?>


    5. add the Banner Manager code in the same place
    <?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
    }
    }
    ?>


    6. Load a banner in Tools>Banner Manager and activate it in "Header Position 3" in Configuration>Layout Settings

    That's that. You might also want to add the orginal stylesheet tags to your banner, in which case the opening tag for it should be...
    [SCR]<div id="bannerThree indexDefaultMainContent" class="content">[/SCR]

  2. #2
    Join Date
    Dec 2008
    Posts
    55
    Plugin Contributions
    0

    Default Re: Change Home Page Content to Banner Manager

    Awesome change! :) Thanks a bunch, that is precisely what I was looking to do.

 

 

Similar Threads

  1. Display EZ Page content in header (like a banner)
    By hockey2112 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 21 Jul 2010, 06:06 PM
  2. No content in my home page!
    By Jdcolfashion in forum General Questions
    Replies: 1
    Last Post: 2 Jul 2010, 10:12 AM
  3. Replies: 3
    Last Post: 20 Oct 2009, 09:34 PM
  4. Home page content - not showing in Define Page Editor.
    By linda408 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 12 Oct 2009, 12:14 AM
  5. How to change layout in center content boxes on home page?
    By alicia1234 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 18 Nov 2008, 04:07 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