Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Dec 2007
    Posts
    126
    Plugin Contributions
    0

    Default Change background color to an image, and banner header

    I would like to change the background color to an image.

    I would also like to have the header banner change to a specified image for each category selected, instead of 1 static image.

    I'm running the latest version of zen cart and I'm slowly learning. So far I'm stoked!

  2. #2
    Join Date
    Dec 2007
    Posts
    126
    Plugin Contributions
    0

    Default Re: Change background color to an image, and banner header

    OK solved one of my questions. I added 'background-image: url(../images/tile_1.gif);' to line 339. of stylesheet.
    PHP Code:
    #navColumnOne, #navColumnTwo {
        
    background-colortransparent;
        
    background-imageurl(../images/tile_1.gif);
        } 

  3. #3
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Change background color to an image, and banner header

    I have just finished a little mod for per-category/per-page header background images, so you are the lucky guinea pig - er - first recipient.

    Description:
    ##########################################################################################___

    Display header bg image for individual top cat, or current page base, if corresponding image exists in /includes/templates/your_template/images/.

    Name images like headerbg_23.gif for cat 23 & subs, or headerbg_shippinginfo.gif for shipping & returns page.
    Name default image headerbg.gif.
    Add a class to your stylesheet for each image, like
    Code:
    #headerWrapper.headerBG_23 { background-image: url(../images/headerbg_23.gif);}
    
    #headerWrapper.headerBG_shippinginfo { background-image: url(../images/headerbg_shippinginfo.gif);}
    with any other styling you desire.

    Find in /includes/templates/your_template/common/tpl_header.php
    PHP Code:
    <!--bof-header logo and navigation display-->
    <?php
    if (!isset($flag_disable_header) || !$flag_disable_header) {
    ?>

    <div id="headerWrapper">
    <!--bof-navigation display-->
    and replace with
    PHP Code:
    <!--bof-header logo and navigation display-->
    <?php
    if (!isset($flag_disable_header) || !$flag_disable_header) {
    ?>
    <!--per-category/per-page header bg images - gjh42  2007-12-11-->
    <!--
    Display header bg image for individual top cat, or current page base, if corresponding image exists in /includes/templates/your_template/images/.
    Name images like headerbg_23.gif for cat 23 & subs, or headerbg_shippinginfo.gif for shipping & returns page.
    Name default image headerbg.gif.
    Add a class to your stylesheet for each image, like 
    #headerWrapper.headerBG_23 { background-image: url(../images/headerbg_23.gif);}
    with any other styling you desire.
    -->
    <?php $alt_header_image '';
    if (
    $current_page_base == 'index' or 'product_info') { //add _ and top cat id to bg filename only if cat bg image exists
      
    $alt_header_image = (file_exists(DIR_WS_TEMPLATE_IMAGES 'headerbg_' str_replace(strstr($_GET[cPath],'_'),'',$_GET[cPath]) . '.gif'))?'_' str_replace(strstr($_GET[cPath],'_'),'',$_GET[cPath]):'';
    } else { 
    //add _ and page base to bg filename only if page bg image exists
      
    $alt_header_image = (file_exists(DIR_WS_TEMPLATE_IMAGES 'headerbg_' $current_page_base '.gif'))?'_' $current_page_base:'';
    }
    ?>
    <!--/per-category/per-page header bg images-->
    <div id="headerWrapper" class="headerBG<?php echo $alt_header_image;?>">
    <!--bof-navigation display-->
    If you want to use jpg or png images, change the instances of ".gif" accordingly.

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Change background color to an image, and banner header

    Erratum: Change
    PHP Code:
    if ($current_page_base == 'index' or 'product_info') { 
    to
    PHP Code:
    if ($current_page_base == 'index' or $current_page_base == 'product_info') { 
    The original appeared to be working correctly while testing, but was apparently changed since the last version I tested.

  5. #5
    Join Date
    Dec 2007
    Posts
    126
    Plugin Contributions
    0

    Default Re: Change background color to an image, and banner header

    Thanks I'm going to give a go right now!

  6. #6
    Join Date
    Dec 2007
    Posts
    126
    Plugin Contributions
    0

    Default Re: Change background color to an image, and banner header

    How would I get this to work with #logoWrapper ?

  7. #7
    Join Date
    Dec 2007
    Posts
    126
    Plugin Contributions
    0

    Default Re: Change background color to an image, and banner header

    I can't get it to work...

  8. #8
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Change background color to an image, and banner header

    Change the
    PHP Code:
    <div id="headerWrapper" class="headerBG<?php echo $alt_header_image;?>">
    back to

    <div id="headerWrapper">,

    and change

    <div id="logoWrapper">

    to
    PHP Code:
    <div id="logoWrapper" class="headerBG<?php echo $alt_header_image;?>">
    Rework the stylesheet declarations like
    Code:
    #logoWrapper {
        background-image: url(../images/headerbg.gif);
        width: xxxpx;
        height: xxxpx;
        }
    
    #logoWrapper.headerBG_23 { background-image: url(../images/headerbg_23.gif);}
    
    #logoWrapper.headerBG_shippinginfo { background-image: url(../images/headerbg_shippinginfo.gif);}

  9. #9
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Change background color to an image, and banner header

    If you want the clickable home link feature of the logo, you will probably best use #logo instead of #logoWrapper. Also, if you are using IE, you will need to edit /includes/languages/english/your_template/header.php to use pixel_trans.gif, so that IE doesn't collapse the div:
    PHP Code:
    define('HEADER_LOGO_IMAGE''logo.gif');

    change to 

    define
    ('HEADER_LOGO_IMAGE''pixel_trans.gif'); 

  10. #10
    Join Date
    Dec 2007
    Posts
    126
    Plugin Contributions
    0

    Default Re: Change background color to an image, and banner header

    Glen sir, I owe you a coke!

    Thank you soo much.

    Works flawless so far.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Background Color For Header Banner.
    By usavape in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 20 Mar 2012, 12:59 AM
  2. Changing Background color of HOME--Login Header/banner
    By RobertG in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 10 Dec 2009, 08:15 PM
  3. Want to change banner size and background color
    By RebelAutoWorxs in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 10 Oct 2008, 06:04 PM
  4. how to change header background color?
    By layoyo in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 10 Oct 2008, 09:41 AM
  5. Customizing the look of the header Search form. Submit image and background color.
    By immersive in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 17 May 2007, 07:51 AM

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