Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2007
    Location
    Dayton, Ohio
    Posts
    672
    Plugin Contributions
    0

    Default Add image to header.tpl file

    Hi. I want to add an additional image to my header (in between my logo and my search box to the right). Normally and in the past, I would/have just added some html to my tpl_header.php page where I want the logo to appear. Then add the style to my stylesheet. This is what I am thinking:

    Code:
    <div id="midheader"><img src="../images/MYIMAGE.gif" width="100" height="60" alt="Mid Header"></div>
    But I am now wondering, if this would be the best practice to just add html to the .tpl php page? Plus, I am running both SSL and non SSL so I am a little worried about that image not showing correctly on each page (if I hard link). The image is in my images folder in my current loaded template. Is this the correct context? I see an aweful lot of syntax that is written in .php (which I am not good at) that looks like this:

    Code:
    <img src="<?php  echo $template->get_template_dir('',DIR_WS_TEMPLATE, $current_page_base,'images').'/'.HEADER_ICON_CART ?>" alt="cart icon" class="cart-icon"  />
    I can get the text in the right area of the tpl_header.php file. And I can figure out how to style it. I am just concerned with the coding I need to add the the tpl_header.php file. Am I OK with the concept of the coding above for this page?

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

    Default Re: Add image to header.tpl file

    Code:
    <div id="midheader"><img src="../images/MYIMAGE.gif" width="100" height="60" alt="Mid Header"></div>
    img src=".. should handle http or https
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Apr 2007
    Location
    Dayton, Ohio
    Posts
    672
    Plugin Contributions
    0

    Default Re: Add image to header.tpl file

    OK so adding this text on the .tpl page will not be an issue. I have done it in the past, but was just wondering if it was not good practice. Thank you.

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Add image to header.tpl file

    OK so adding this text on the .tpl page will not be an issue
    Just use the template override system
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Apr 2007
    Location
    Dayton, Ohio
    Posts
    672
    Plugin Contributions
    0

    Default Re: Add image to header.tpl file

    The image URL is not correct so it is not directing to my template folder. I have this coding:

    Code:
    <div id="midheader"><img src="../images/midheader.png" alt="Best of Cincinnati Award"></div>
    When I look at the source of the page, I see this:

    Code:
    <div id="midheader"><img src="../images/midheader.png" alt="Best of Cincinnati Award"></div>
    I am sorry for such a simple question, but how do I make this URL direct to my images folder (without putting in the whole URL)?

  6. #6
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Add image to header.tpl file

    Oh your cart is in a folder....

    Try
    Code:
    <div id="midheader"><img src="../store/images/midheader.png" alt="Best of Cincinnati Award"></div>
    Zen-Venom Get Bitten

  7. #7
    Join Date
    Apr 2007
    Location
    Dayton, Ohio
    Posts
    672
    Plugin Contributions
    0

    Default Re: Add image to header.tpl file

    Ohhh I see. I am supposed to put the image in the root image folder as the base of my shop. I was keeping the image in my customized template image folder. I just put the full URL with the https, so it will show in the non-SSL store; and when I go to the SSL store my users do not get the security notification. The way I do it now it shows my template folder in the source code. But I noticed the URL gives away the template location anyway, for other generated images as well.

  8. #8
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Add image to header.tpl file

    That is what the php does - points to the template/images folder
    Code:
    DIR_WS_TEMPLATE, $current_page_base,'images')
    Zen-Venom Get Bitten

 

 

Similar Threads

  1. which tpl file?
    By creff in forum Templates, Stylesheets, Page Layout
    Replies: 13
    Last Post: 26 Oct 2009, 04:10 PM
  2. Blank Sidebox TPL file Apostrophe
    By ryanb4614 in forum Basic Configuration
    Replies: 2
    Last Post: 19 Aug 2009, 02:01 PM
  3. php code question...placement tpl header file
    By bwhitmire in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 22 Sep 2008, 03:56 PM
  4. header.php and tpl header image remover
    By d1rage5 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 14 Jul 2008, 09:56 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