Forum Moderators: open

Message Too Old, No Replies

Putting a header on my pages

How?

         

seamus

6:36 pm on Sep 24, 2005 (gmt 0)

10+ Year Member



Is it possible to have all my pages display a header that is actually located on a different page?

I want to do this so that I will only have to edit the header page when I add a new link to site navigation.

Is this what <thead> is for? And if so, can anyone lead me to info on how to use it?

rocknbil

7:05 pm on Sep 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No <thead> is a special tag for table heading rows.

The simplest way is with server side includes:

<html><head><title>My Page</title></head>
<body>
<!--#include file="header.txt" -->
Page content
</body>
</html>

If you store the header in a different directory, use
<!--#include virtual="/data/header.txt" -->

In either case,
1) SSI's MUST be enabled on your server. Refer to your ISP to find out (or just try it, if it works, great.)
2) The file MUST be named whith an .shtml extension to tell the server to parse for SSI directives (myfile.shtml)
3) The space preceding --> is REQUIRED or it won't work.

There are other ways, via Javascript or dynamic languages such as perl, php, asp, etc., that essentially do the same thing, but this is the simplest.

Welcome to Webmaster World! :-)

seamus

8:20 pm on Sep 24, 2005 (gmt 0)

10+ Year Member



Wow! Thanks,

That worked great. I should have come here first :)