Thread: tpl header

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    May 2006
    Posts
    725
    Plugin Contributions
    0

    Default tpl header

    hi there,

    i made a header navigation in photoshop and uploaded it to zen cart. i managed to get it to show by deleting everything in the tpl_header.php and putting "php?includes" on its own. Im wondering if there are codes that i should have left in this file and if so, which ones are they.

    also, for the links, can i just put "index.php?main_page=contact_us" or do i have to put the complete address?

    the site is www.animestrike.co.uk.

    thanks in advance :)

  2. #2
    Join Date
    May 2006
    Posts
    725
    Plugin Contributions
    0

    Default Re: tpl header

    ok, i managed to do my question above but i still have 1 last question.

    how do i make the log in button turn to log off when there's a member logged in? i have seen it done in other zen-cart shops but i can't figure out how to do it.

    thank you

  3. #3
    Join Date
    Jan 2007
    Posts
    236
    Plugin Contributions
    0

    Default Re: tpl header

    nice site but your nav buttons are very hard to read

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: tpl header

    You can control the buttons with an if statement such as:

    <?php if ($_SESSION['customer_id']) { ?>
    <a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a>
    <?php } else { ?>
    <a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a>
    <?php } ?>
    You'd have to fool with the button link and the image size vs the text shown here etc.
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    May 2006
    Posts
    725
    Plugin Contributions
    0

    Default Re: tpl header

    Hi Ajeh,

    Can I add those statement inside an html? Both my tpl_header and html are below.

    tpl_header:

    <?php
    /**
    * Common 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 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 include 'header.html' ?>


    header html:

    <html>
    <head>
    <title>Header 2e</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <!-- ImageReady Slices (Header 2e.psd) -->
    <table id="Table_01" width="800" height="300" border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td colspan="10">
    <img src="images/header_01.jpg" width="800" height="40" alt=""></td>
    </tr>
    <tr>
    <td rowspan="5">
    <img src="images/header_02.jpg" width="11" height="260" alt=""></td>
    <td>
    <a href="/shop/">
    <img src="images/header_03.jpg" width="97" height="28" border="0" alt=""></a></td>
    <td>
    <a href="/shop/index.php?main_page=login">
    <img src="images/header_04.jpg" width="97" height="28" border="0" alt=""></a></td>
    <td>
    <a href="/shop/index.php?main_page=account">
    <img src="images/header_05.jpg" width="97" height="28" border="0" alt=""></a></td>
    <td colspan="6" rowspan="3">
    <img src="images/header_06.jpg" width="498" height="220" alt=""></td>
    </tr>
    <tr>
    <td>
    <a href="/shop/index.php?main_page=shopping_cart">
    <img src="images/header_07.jpg" width="97" height="28" border="0" alt=""></a></td>
    <td>
    <a href="/shop/index.php?main_page=checkout_shipping">
    <img src="images/header_08.jpg" width="97" height="28" border="0" alt=""></a></td>
    <td>
    <a href="/shop/index.php?main_page=contact_us">
    <img src="images/header_09.jpg" width="97" height="28" border="0" alt=""></a></td>
    </tr>
    <tr>
    <td colspan="3">
    <img src="images/header_10.jpg" width="291" height="164" alt=""></td>
    </tr>
    <tr>
    <td>
    <a href="/shop/index.php?main_page=index&cPath=1">
    <img src="images/header_11.jpg" width="97" height="29" border="0" alt=""></a></td>
    <td>
    <a href="/shop/index.php?main_page=index&cPath=2">
    <img src="images/header_12.jpg" width="97" height="29" border="0" alt=""></a></td>
    <td>
    <a href="/shop/index.php?main_page=index&cPath=3">
    <img src="images/header_13.jpg" width="97" height="29" border="0" alt=""></a></td>
    <td>
    <a href="/shop/index.php?main_page=index&cPath=4">
    <img src="images/header_14.jpg" width="97" height="29" border="0" alt=""></a></td>
    <td>
    <a href="/shop/index.php?main_page=index&cPath=5">
    <img src="images/header_15.jpg" width="97" height="29" border="0" alt=""></a></td>
    <td>
    <a href="/shop/index.php?main_page=index&cPath=6">
    <img src="images/header_16.jpg" width="97" height="29" border="0" alt=""></a></td>
    <td>
    <a href="/shop/index.php?main_page=index&cPath=7">
    <img src="images/header_17.jpg" width="97" height="29" border="0" alt=""></a></td>
    <td>
    <a href="/shop/index.php?main_page=index&cPath=8">
    <img src="images/header_18.jpg" width="97" height="29" border="0" alt=""></a></td>
    <td rowspan="2">
    <img src="images/header_19.jpg" width="13" height="40" alt=""></td>
    </tr>
    <tr>
    <td colspan="8">
    <img src="images/header_20.jpg" width="776" height="11" alt=""></td>
    </tr>
    </table>
    <!-- End ImageReady Slices -->
    </body>
    </html>

    Thank you

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: tpl header

    Something along the lines of:
    PHP Code:
    <td>
    <a href="/shop/index.php?main_page=login">
    <?php echo ($_SESSION['customer_id'] < '<img src="images/header_04.jpg"' '<img src="images/header_04OUT.jpg"'); ?> width="97" height="28" border="0" alt=""></a></td>
    <td>
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    May 2006
    Posts
    725
    Plugin Contributions
    0

    Default Re: tpl header

    Hi,

    That worked really well. I added a logoff link inside the php code. Is that ok or is there a much better way of doing it?

    <td>
    <a href="/shop/index.php?main_page=login">
    <?php echo ($_SESSION['customer_id'] < 1 ? '<img src="images/header_04.jpg"' : '<a href="/shop/index.php?main_page=logoff"><img src="images/header_04b.jpg></a>"'); ?> width="97" height="28" border="0" alt=""></a></td>

    Thanks so much!

  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: tpl header

    The better solution than either is:
    PHP Code:
    <?php if ($_SESSION['customer_id'] <= 0) { ?>
    <a href="<?php echo zen_href_link(FILENAME_LOGIN'''SSL'); ?>"><img src="images/header_04.jpg" width="97" height="28" border="0" alt=""></a>
    <?php } else { ?>
    <a href="<?php echo zen_href_link(FILENAME_LOGOFF'''SSL'); ?>"><img src="images/header_04b.jpg" width="97" height="28" border="0" alt=""></a>
    <?php ?>
    This runs the right image and does it with the secure/non-secure ability etc.
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  9. #9
    Join Date
    May 2006
    Posts
    725
    Plugin Contributions
    0

    Default Re: tpl header

    Quote Originally Posted by Ajeh View Post
    The better solution than either is:
    PHP Code:
    <?php if ($_SESSION['customer_id'] <= 0) { ?>
    <a href="<?php echo zen_href_link(FILENAME_LOGIN'''SSL'); ?>"><img src="images/header_04.jpg" width="97" height="28" border="0" alt=""></a>
    <?php } else { ?>
    <a href="<?php echo zen_href_link(FILENAME_LOGOFF'''SSL'); ?>"><img src="images/header_04b.jpg" width="97" height="28" border="0" alt=""></a>
    <?php ?>
    This runs the right image and does it with the secure/non-secure ability etc.
    Hello,

    I tried the above and it works and runs the right images but I have all these lines around the images for some reason. Can this be removed or should I just opt for the previous script?

    Thank you

  10. #10
    Join Date
    May 2006
    Posts
    725
    Plugin Contributions
    0

    Default Re: tpl header

    Ajeh,

    I forgot to add that these lines are only visible in Internet Explorer. They do not appear in Firefox.

    Thanks again

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 Add image to header.tpl file
    By sports guy in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 13 Nov 2012, 09:45 PM
  2. 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
  3. Header & footer tpl files
    By heimskr75 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 5 Jan 2008, 03:02 PM
  4. Categorie Images in header.tpl
    By bmac in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 7 Jun 2006, 05:15 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