Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Load HTML within HTML file

Status
Not open for further replies.

KeyserSoze1877

Programmer
Sep 6, 2001
95
US
I am a Cold Fusion programmer at heart. But I am designing two web apps for a non-CF hosted area.

I am a fuse box developer and I am trying to build these sites as close to that methodolgy as I can...

Anyhow...

These websites have many pages to them, all non DB supported, so static. I want to create a menu and other elements once and use them in all the pages, so when I change the menu I only have to do it in one place. Just like the <cfinclude template=""> in CF. I have been looking at javascript, DHTML, CSS for help and can't find a solution. HELP!

Thanks.
 
ah, the keyword you want here is SSIs: FAQ253-3309 and FAQ253-2000.

If you find you need more info after reading the FAQs, please post back!

<marc> i wonder what will happen if i press this...[ul][li]please tell us if our suggestion has helped[/li][li]need some help? faq581-3339[/li][/ul]
 
If I go this route I will learn PHP instead. The server that will host has PHP enabled. I just didn't want to have to put the time in for a one time build and forget web site.

I can work around it with Frames, no matter how much I despise them.
 
really, an SSI file include is very easy to do:

save the template as plain text: e.g. "menu.include"
Code:
<ul id="menu">
  <li><a href="/index.html">Home</a></li>
  <li><a href="/about.html">About</a></li>
  <li><a href="/contact.html">Contact Us</a></li>
</ul>

here's the line (put it wherever you want the template loaded in the html) to include it:
Code:
<!--#include virtual="/menu.include" -->

You may need some server configuring to activate SSIs.

<marc> i wonder what will happen if i press this...[ul][li]please tell us if our suggestion has helped[/li][li]need some help? faq581-3339[/li][/ul]
 

If you'd rather not go server-side, then go with a JavaScript option, unless you need a non-JS menu (for accessibility reasons, etc).

Hope this helps,
Dan


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top