Page 1 of 1

Code help..

Posted: Tue Dec 01, 2009 9:19 pm
by Graham
Howdy all,

I've been having some problems with some code, or finding some code!

What I'm trying to do for a project site at work is basically have a header file, a menu file and an index file.

The header & menu files will be shown on all pages and the index file will be unique for each page, this way I only need to update the menu/header once instead of many many more times on each index.html file.

I've googled and googled and googled but can't find much apart from turning on settings on hosting sites but I'm trying to start this from scratch starting with HTML.

Has anyone got any example code of something basic such as a index.html file with a menu on the left hand side, a header up the top and the body which fits in nicely?

Much appreciated, thanks!

Posted: Tue Dec 01, 2009 9:59 pm
by The X
I think what you might be after is "frames"?

Posted: Tue Dec 01, 2009 10:15 pm
by Aspired

Posted: Tue Dec 01, 2009 10:27 pm
by Graham
Thanks guys i'll have a look at it tomorrow at work when it's quiet

I don't know much at all about php so that'd be a fail for me but I'll check out frames :)

Posted: Wed Dec 02, 2009 7:44 am
by draevon
Frames for sure, although less and less site use them these days ... they don't play so well with searchengine spiders and the like:

<html>
<head>

</head>
<frameset cols="180,*" border="0">
<frame src="menu.htm" noresize scrolling="no">
<frameset rows="60,*" border="0">
<frame src="top.htm" noresize scrolling="no">
<frame src="page.htm" name="main" border="0">
</frameset>
</frameset>
</html>

Posted: Wed Dec 02, 2009 8:57 am
by Chubb
Like draevon said frames are being used less today, an alternative that I like to use are DIV blocks as you can do any thing you like with them.

Posted: Tue Dec 15, 2009 10:08 pm
by Razoxane
You might want to try some AJAX - Asynchronous Javascript and XML. There are heaps of tutorials around, and when I'm at work tommorrow (off the iPhone which is crap for finding example links!) I'll post some good ones.

Basically, you have one HTML page consisting of the menu, and on all other pages, a chunk of JavaScript which sucks the content of that page and dumps it into a div.

Does your hosting providor support PHP and/or ASP? Ideally, you'd use a content management system, which would build menus automatically, but that can be a pain to set up.