Results 1 to 10 of 18

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Posts
    96
    Plugin Contributions
    0

    Default Using a Table with Rollover Images in the tpl_header.php

    I've searched and found a lot of "close" but no cigar help posts on here, so I figured I ask the exact question in hopes one of the experts can help me.

    I created a nice image rollover link bar in PhotoShop/Image Ready, and I have it as a table set up on all of my pages.

    My question is if there is a way to insert some code into the tpl_header.php to make this function. I know how to put the table in, that's a snap.

    But the rollover function requires that there be coding between the <head> </head> tags on an HTML page, and an onload="preloadImages in the <body> tag in order for the rollover images to function.

    I don't know enough about PHP to know how to accomplish this, so I was hoping it was possible and that someone can help me here.

    If it's not possible that way, what about inserting a header page into the code? What I mean is I have a page header.html that I use for other html pages, and then I only have to update that page when I make changes to links, etc. and it doesn't take me forever to edit all the pages accessing that file. Can I insert code in PHP that will reference an html file?

    Thanks

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

    Default Re: Using a Table with Rollover Images in the tpl_header.php

    What I have done and seen others do for this is to take your image and slice it into distinct areas. Then in the descrption of the display for these items you define the href link for each item. this can be done in html as long as you locate it outside of the php tags in your tpl_header.php give it a class and define your rollover effects in the css file.

  3. #3
    Join Date
    Feb 2006
    Posts
    96
    Plugin Contributions
    0

    Default Re: Using a Table with Rollover Images in the tpl_header.php

    Thanks, sometimes it's just too easy and you don't see it

    Googled it and found my answer

    <? include("header.html") ?>

    Worked PERFECTLY!

  4. #4
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default Re: Using a Table with Rollover Images in the tpl_header.php

    Hi, I wonder if you could help me with this? I am upgrading from 1.2.7 to 1.3.0.2. I referenced header.html, this is the code in the header.html file:

    <tr><td>

    <table border="0" width="100%" cellspacing="0" cellpadding="0" class="header">
    <tr>
    <td background="includes/templates/custom/images/stripedbg1.gif"><img src="includes/templates/custom/images/stripedbg1_graphic.gif" width="180" height="18"></td>
    </tr>

    <tr>
    <td valign="top">
    <table width="100%" style="border: #267A96; border-style: dotted; border-top-width: 4px; border-right-width: 0px; border-bottom-width: 4px; border-left-width: 0px;" cellspacing="0" cellpadding="0" bgcolor="#DAF0F6">
    <tr valign="top">
    <td width="28%">
    <div align="center"><img src="includes/templates/custom/images/boutique_top.gif" width="204" height="195" alt="copyright"></div>
    </td>
    <td width="48%">
    <div align="center"><img src="includes/templates/custom/images/webtopper_name.gif" width="350" height="195" alt="Babies N Bellies"></div>
    </td>
    <td width="24%">
    <div align="center"><img src="includes/templates/custom/images/lady_store.gif" width="114" height="195" alt="copyright"></div>

    </td>
    </tr>
    </table>
    <table border="0" cellspacing="0" cellpadding="0" class="headerNavigation" align="center">
    <tr class="headerNavigation">
    <td width="17%">
    <div align="center"><a href="" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('home','','fpdb/images/Theme0/homebtn_over.gif',1)"><img name="home" border="0" src="fpdb/images/Theme0/homebtn.gif" width="125" height="40" alt="Home"></a></div>

    </td>
    <td width="19%">
    <div align="center"><a href="index.php?main_page=infopages&pages_id=6" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('about','','fpdb/images/Theme0/aboutbtn_over.gif',1)"><img name="about" border="0" src="fpdb/images/Theme0/aboutbtn.gif" width="125" height="40" alt="About Us"></a></div>
    </td>
    <td width="18%">
    <div align="center"><a href="index.php?main_page=infopages&pages_id=7" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('bellcash','','fpdb/images/Theme0/bellycashbtn_over.gif',1)"><img name="bellcash" border="0" src="fpdb/images/Theme0/bellycashbtn.gif" width="125" height="40" alt="belly cash"></a></div>
    </td>
    <td width="14%">
    <div align="center"><a href="index.php?main_page=infopages&pages_id=8" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('press','','fpdb/images/Theme0/pressbtn_over.gif',1)"><img name="press" border="0" src="fpdb/images/Theme0/pressbtn.gif" width="125" height="40" alt="press"></a></div>
    </td>

    <td width="16%">
    <div align="center"><a href="index.php?main_page=infopages&pages_id=9" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('faq','','fpdb/images/Theme0/faqbtn_over.gif',1)"><img name="faq" border="0" src="fpdb/images/Theme0/faqbtn.gif" width="125" height="40" alt="faq"></a></div>
    </td>
    <td width="16%">
    <div align="center"><a href="index.php?main_page=contact_us" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('contact','','fpdb/images/Theme0/contactbtn_over.gif',1)"><img name="contact" border="0" src="fpdb/images/Theme0/contactbtn.gif" width="125" height="40" alt="contact"></a></div>
    </td>
    </tr>
    </table>
    <table width="100%" style="border: #D05489; border-style: dotted; border-top-width: 4px; border-right-width: 0px; border-bottom-width: 4px; border-left-width: 0px;" cellspacing="0" cellpadding="0">
    <tr>
    <td background="includes/templates/custom/images/stripedbg1.gif" valign="top"><img src="includes/templates/custom/images/stripedbg1_graphic.gif" width="180" height="18"></td>

    </tr>
    </table>
    </td>
    </tr>
    It worked perfectly on 1.2.7, but not on the new version. Nothing happens on the mouseover. What am I doing wrong?

    Thanks!

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

    Default Re: Using a Table with Rollover Images in the tpl_header.php

    You are using the old file that references many TD's(tables) and there are very few in 1.3.x.. Use a program like win merge or another and port the pertinent information to a copy of this file from the 1.3.x install.

  6. #6
    Join Date
    Feb 2006
    Posts
    96
    Plugin Contributions
    0

    Default Re: Using a Table with Rollover Images in the tpl_header.php

    I'm not expert, but I had problems with my images until I hard coded the path into the header.html file, vs images/picture.jpg

    Once I used the full path, http://mydomain.com/images/picture.jpg all the images showed up perfectly and worked great.

    Mike

  7. #7
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default Re: Using a Table with Rollover Images in the tpl_header.php

    Quote Originally Posted by kobra
    You are using the old file that references many TD's(tables) and there are very few in 1.3.x.. Use a program like win merge or another and port the pertinent information to a copy of this file from the 1.3.x install.
    That is what I did...my header.html file only contains the needed info. My tpl_header.php file is the 1.3 version, but I deleted all the nav and logo code since I don't need it.

  8. #8
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default Re: Using a Table with Rollover Images in the tpl_header.php

    Quote Originally Posted by kobra
    You are using the old file that references many TD's(tables) and there are very few in 1.3.x.. Use a program like win merge or another and port the pertinent information to a copy of this file from the 1.3.x install.
    Hi, sorry, I think I know why you're mixed-up, it's my fault, I'm not talking about the site in my siggy, I'm talking about a different site :)

 

 

Similar Threads

  1. 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
  2. I cant get the php include statement to work in the tpl_header file.
    By buxton1 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 23 Oct 2009, 12:16 AM
  3. Oops! Help with tpl_header.php file.
    By sfklaas in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 25 Mar 2008, 02:51 AM
  4. tpl_header.php file additions with html - wheres the css ?
    By kitchen table legs in forum Templates, Stylesheets, Page Layout
    Replies: 13
    Last Post: 21 Sep 2007, 08:09 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