Page 1 of 1

HTML Question

Posted: Tue Jun 10, 2008 7:02 pm
by Andrew_b
Is it possible for an html file to use contents from another html file? I am asking this because i know my website is probably going to have about 30 + pages, and i dont feel like editing them all everytime i add a new page. So i was wondering, Is there a code like the following that will use contents from another html file.

Code: Select all

<!-- NAVIGATION STARTS HERE -->

  <table border="0" cellpadding="0"cellspacing="0" width="100%">
   <tbody>

    <link rel="contents" type="text/html" href="./links.html" />

   </tbody>
  </table>

<!-- NAVIGATION ENDS HERE -->
And the links.html would inclue this:

Code: Select all

<tr>
    <td class="navleft" width="2" height="0"></td>
    <td class="navmiddle" align="center"><a href="./index.html">Home</a></td>
    <td class="navright" width="2"></td></tr><tr>
    <td class="navleft" width="2" height="0"></td>
    <td class="navmiddle" align="center"><a href="./programs.html">Programs</a></td>
    <td class="navright" width="2"></td></tr><tr>
    <td class="navleft" width="2" height="0"></td>
    <td class="navmiddle" align="center"><a href="./information.html">Information</a></td>
    <td class="navright" width="2"></td></tr>
So then if all my pages were linked with links.html, I could edit all my links with this one file instead of editing all my pages.

So heres my question: Is this possible at all?

Posted: Tue Jun 10, 2008 7:07 pm
by FleetAdmiralBacon
Not directly.
You can use an iframe and load something else into it, but you can't import with just HTML.

But why are you using pure HTML? No one does pure HTML anymore.
Get yourself a scripting language. Go with one of the P's (PHP, Perl, Python). Tasks such as this are menial and quick in these tools.

Posted: Tue Jun 10, 2008 7:10 pm
by Andrew_b
FleetAdmiralBacon wrote:Not directly.
You can use an iframe and load something else into it, but you can't import with just HTML.

But why are you using pure HTML? No one does pure HTML anymore.
Get yourself a scripting language. Go with one of the P's (PHP, Perl, Python). Tasks such as this are menial and quick in these tools.
They dont use HTML anymore. Wow.

Well what should i do to accomplish this?

How do i use iframes? im looking for tuts now.

Posted: Tue Jun 10, 2008 7:25 pm
by Tural
He's correct. No self-respecting web developer would use on HTML, it's just not practical for anything. With something such as PHP, it's one simple line [include('links.php');], but with HTML, you're going to have to use frames, and nobody likes frames. =/

Posted: Tue Jun 10, 2008 7:29 pm
by Andrew_b
I can tell why no one likes frames. (I hate them just by working with them for 2 minutes.)

Well i guess i should move on. I think i will go with php since tural showed me its easy to work with. Thanks for the help everyone.