Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2008
    Posts
    12
    Plugin Contributions
    0

    Default Insert Image into Tpl_header.php

    Hi,

    i'm a total PHP noob in the middle of customising the acadame template for my shop. i want to insert an image into a div in the header but cant figure out how to do it. I've got round the problem by using a background image to get the banner where i want it but its not the solution i'm looking for as i want it to be clickable. Can anyone help?

    Heres the Tpl_header.php i'm trying t edit, i've marked the<div> where i'd like to place the image. any help would be greatly appreciated :)

    <?php
    /**
    * Acadame Template - tpl_header.php
    *
    * this file can be copied to /templates/your_template_dir/pagename<br />
    * example: to override the privacy page<br />
    * make a directory /templates/my_template/privacy<br />
    * copy /templates/templates_defaults/common/tpl_footer.php to /templates/my_template/privacy/tpl_header.php<br />
    * to override the global settings and turn off the footer un-comment the following line:<br />
    * <br />
    * $flag_disable_header = true;<br />
    *
    * @package templateSystem
    * @copyright Copyright 2007 iChoze Internet Solutions http://ichoze.com
    * @copyright Portions Copyright 2003-2006 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: tpl_header.php 4813 2006-10-23 02:13:53Z drbyte $
    */
    ?>

    <?php
    // Display all header alerts via messageStack:
    if ($messageStack->size('header') > 0) {
    echo $messageStack->output('header');
    }
    if (isset($_GET['error_message']) && zen_not_null($_GET['error_message'])) {
    echo htmlspecialchars(urldecode($_GET['error_message']));
    }
    if (isset($_GET['info_message']) && zen_not_null($_GET['info_message'])) {
    echo htmlspecialchars($_GET['info_message']);
    } else {

    }
    ?>


    <!--bof-header logo and navigation display-->
    <?php
    if (!isset($flag_disable_header) || !$flag_disable_header) {
    ?>
    <div id="headerWrapper">
    <div id="topBarWrap">




    !!!!!!!!!! I WANT TO PUT AN IMAGE IN HERE!!!!!!!!!!!!!!



    </div>
    <div id="logoWrap">

    <div id="topLinks">
    <?php if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) {
    require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_header.php');
    } ?>
    </div><br class="clearBoth" />
    </div>
    </div>
    <?php } ?>



    Ric

  2. #2
    Join Date
    Dec 2006
    Posts
    130
    Plugin Contributions
    0

    Default Re: Insert Image into Tpl_header.php

    If you want it to be clickable, a simple solution is to replace the zen cart logo featured at the top, assuming you haven't removed it. Then you can have your background header, with a clickable image on top.

    Peace.

  3. #3
    Join Date
    Aug 2008
    Posts
    12
    Plugin Contributions
    0

    Default Re: Insert Image into Tpl_header.php

    hey,

    thank for the reply.

    unfortunately i don't have the zen cart logo on the page any more, i've kind of stripped the page down for a cleaner look and now don't have much to work with

    is there a simple way to display an image within a DIV in a PHP file the same way you would display an image in HTML using <img src>

    ric

  4. #4
    Join Date
    Dec 2006
    Posts
    130
    Plugin Contributions
    0

    Default Re: Insert Image into Tpl_header.php

    Yeah, I did the same thing...went with a much cleaner/leaner look.

    What you might be able to do is simply dload Zen Cart again and just grab the file containing the logo part, then grab just that code and subsequently drop it in your new site.

  5. #5
    Join Date
    Aug 2008
    Posts
    12
    Plugin Contributions
    0

    Default Re: Insert Image into Tpl_header.php

    yeah, i was thinking that. i'll give it a shot

    your site's cool btw

  6. #6
    Join Date
    Dec 2006
    Posts
    130
    Plugin Contributions
    0

    Default Re: Insert Image into Tpl_header.php

    > your site's cool btw

    Word, thanks.

 

 

Similar Threads

  1. How do I insert PHP code into 'define_page_x.php'?
    By oavs in forum General Questions
    Replies: 1
    Last Post: 7 Nov 2011, 09:46 AM
  2. Is it possible to insert an image into order updates ?
    By PatF in forum General Questions
    Replies: 1
    Last Post: 19 Aug 2011, 05:40 PM
  3. centering header image with tpl_header.php
    By praiseandplay in forum Templates, Stylesheets, Page Layout
    Replies: 21
    Last Post: 23 Jan 2010, 04:29 AM
  4. Inserting Code into tpl_header.php
    By drymetal in forum Templates, Stylesheets, Page Layout
    Replies: 37
    Last Post: 21 Jan 2010, 10:07 AM
  5. putting tpl_categories_css.php into tpl_header?
    By atracksler in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 26 Oct 2006, 08:59 PM

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