Forum Moderators: open
It sounds like you're aiming in a good general direction. It can be a big help to only update one file and have pages change across the site.
But I'm not clear if you are talking about using SSI (server side includes) or using the "includes" built into in a specific bit of WYSIWYG software, such as FrontPage. I don't use that kind of software, so I'm not sure if they have sections they call header and footer.
There is no specific HTML tag for header or footer - we just use those terms as general descriptions for parts of the page -- and WYSIWG software may do the same.
That search may answer your questions, or at least help focus them so you can come back with a more precise description of what's not working out for you. Lots of good help here, so feel free to ask more if the research doesn't do it for you.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<table cellspacing="2" cellpadding="2" border="0">
<tr>
<td colspan="2">Logo and stuff for the top</td>
</tr>
<tr>
<td>
<table>
<tr>
<td><a href="#">home</a></td>
</tr>
<tr>
<td><a href="#">about</a></td>
</tr>
<tr>
<td><a href="#">contact</a></td>
</tr>
<tr>
<td><a href="#">products</a></td>
</tr>
</table>
</td>
<td>
<!-- End of Header -->
Here is a content page that calls the header and footer:
<!-- Content Below -->
<table>
<tr>
<td>All of your content</td>
</tr>
</table>
<!-- Content Above -->
Then your Footer:
<!-- Start Footer -->
</td>
</tr>
</table>
</body>
</html>
I use ASP includes. I am not sure how to call SSi includes. What ever it is it will mostlikely be a one line comment.
<HTML>
<HEAD>
<TITLE>Test</TITLE>
</HEAD>
<body bgcolor="#FFFEF5" background="images/bg.jpg">
<PRE>
<!--#include virtual="head.html"-->
</PRE>
<PRE>
<!--#include virtual="foot.html"-->
</PRE>
</BODY>
</HTML>
Is that wrong?
I also put the .htaccess file in the directory with this source
AddType text/html .htm .html .shtm .shtml .sht
AddHandler server-parsed .htm .html .shtml .sht .shtm
Options IncludesNoExec
If a site is not SSI enabled can it ever be enabled?
As for the include files - they can have whatever file extension you want.
My site is broken into three distinct sections. Each section has its own colour scheme (handled by separate stylesheets), but all pages have the same navigation controls at the top & bottom (header & footer).
Here's an (annotated & made-up) example of what a raw HTML page of mine looks like (that is, before it makes it to the visitor, ie. pre-includes), plus a header & footer include. Hopefully it'll help or inspire bigger & better ideas...
If I've done this right, you should be able to copy, paste & save the text in each of the following boxes into the indicated bold filenames, and things will work.
(In my setup, I have my include files in a directory called "includes". Adjust directory names below as necessary...)
index.shtml
<html><!-- Start off normally -->
<head>
<title>This is a demo of SSI use</title><!-- I don't like the default SSI error message -->
<!--#config errmsg="Oh man, something's seriously foobarred!"--><!-- Add page-specific meta tags -->
<meta name="description" content="This page demonstrates SSI use for headers and footers.">
<meta name="keywords" content="demo,header,footer,SSI"><!-- Bring in the header -->
<!--#include virtual="/includes/section_a_header.inc"--><!-- Now for some page content -->
<h1 title="SSI Demo!">SSI Demo!</h1><p>"Progress is great, but it's gone on far too long." - Ogden Nash</p>
<!-- Bring in the footer -->
<!--#include virtual="/includes/footer.inc"-->
section_a_header.inc
<!-- These metas go on all pages -->
<meta name="copyright" content="2003 balam">
<meta name="author" content="balam"><!-- Other HTML HEAD stuff goes here -->
<!-- JavaScript stuff -->
<!-- CSS stuff -->
<!-- HR Pufnstuf --><!-- Done with HEAD, let's move on -->
</head>
<body><!-- I have a big table for site navigation here -->
<!-- Damned if I'm typing that in! -->
footer.inc
<!-- A small navigation bar resides here -->
<!-- Followed by copyright and contact info -->
<p>Copyright 2003 balam</p><!-- I'm tired, let's go home... -->
</body>
</html>
For my site and its three sections, I have 3 header includes, 1 footer and 3 stylesheets.
Ok, as I mention in the footer, I'm tired. I've added my two cents and hopefully earned five for good work...
balam