Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14
  1. #11
    Join Date
    Oct 2008
    Posts
    4
    Plugin Contributions
    0

    Default Re: Two Separate Header Files

    Quote Originally Posted by kobra View Post
    If only for main page - look at tpl_main_page.php and find
    Code:
    $body_id = ($this_is_home_page) ? 'indexHome' : str_replace('_', '', $_GET['main_page']);
    Then what?

  2. #12
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Two Separate Header Files

    There are many posts about "$this_is_home_page" and this is the key....it will be either true or false depending on whether the user is on the home page of the store or not.

    So, in your tpl_header.php file, you can add some PHP code that checks for the value of $this_is_home_page, and displays XX if it is true, and regular output otherwise.

    There are several other forum posts which talk about $this_is_home_page for many different implementations.
    Zen-Venom Get Bitten

  3. #13
    Join Date
    Jan 2009
    Location
    Victoria Australia
    Posts
    100
    Plugin Contributions
    0

    Default Re: Two Separate Header Files

    Hello all, I was after two separate headers as well.
    One for the main page and a different one for everything else.
    My two are basically the same but different size images.
    I'm using the latest zen-cart and cherry zen template (fluid site)
    I'm new to all this, but thought I would post what I found worked for me.
    Of course there are probably different was to do this and your files might be different than mine, but this might help other newbies.

    First obviously, I created and uploaded the two image files.

    Then in includes/languages/english/cherry_zen/header.php I added one new define

    exmp_header.doc

    Then in includes/templates/cherry_zen/common/tpl_header.php, modified the following lines

    exmp_tpl_header.doc

    Of course your file structure will probably be different, but those are the two files that I modified to get it to work for me.
    I hope this helps some one,
    David

    One more note, I didn't create a new define for the main page image alt text, but I'm sure you could if you wanted to.

  4. #14
    Join Date
    Jan 2009
    Location
    Victoria Australia
    Posts
    100
    Plugin Contributions
    0

    Default Re: Two Separate Header Files

    Sorry guys, my newbieness is showing.
    I was trying to put the file excerpts into those little boxes.
    Her is a cut and paste.

    header.php

    // added defines for header alt and text
    define('HEADER_ALT_TEXT', 'Country to the Core Logo');
    define('HEADER_SALES_TEXT', '');
    define('HEADER_LOGO_WIDTH', '500px');
    define('HEADER_LOGO_HEIGHT', '550px');
    define('HEADER_LOGO_IMAGE', 'header_img.png');
    define('MAIN_PAGE_HEADER_LOGO_IMAGE', 'main_page_header_img.png');

    and tpl_header

    <!--bof-branding display-->
    <div id="logoWrapper" class="clearfix">
    <div id="logo">
    <!--my changes for two headers-->

    <?php if ($this_is_home_page) {
    echo zen_image($template->get_template_dir(MAIN_PAGE_HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . MAIN_PAGE_HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '';
    }
    else
    {

    echo zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '';
    }
    ?>
    </div>

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Two Separate Checkouts?
    By AaronHicks in forum Managing Customers and Orders
    Replies: 2
    Last Post: 11 Aug 2011, 06:33 AM
  2. Can Two Separate Products Share Same Inventory?
    By Jeff_Mash in forum General Questions
    Replies: 3
    Last Post: 14 Jan 2009, 10:52 PM
  3. Two currencies with separate shipping rates?
    By kylelondonuk in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 6
    Last Post: 11 Jul 2007, 08:54 AM
  4. CSS Flyout Menu - separate to two main categories
    By TomCZ in forum General Questions
    Replies: 0
    Last Post: 17 Mar 2007, 08:07 PM
  5. Two separate classes for hyperlinks
    By DJBobble in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 13 Sep 2006, 11:30 AM

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