tags:

views:

37

answers:

3

I want to create some html help pages, separate html pages.

However, I want to have the same content on the top and bottom of the pages.

In the past I've used PHP or ASP, with header and footer files. I've then had to do view source and save these pages to get what I want.

I just wondered if there an easiest way to do this ?

EDIT: The pages are for use with software using a web object not a normal browser. So there won't be a web server

+2  A: 

If your web server supports it, you could do server side includes

DGM
See extra info above.
Jules
+1  A: 

You could use frames, but it's not necessarily advisable (for one, it breaks navigation).

You could use XML files with an XSLT stylesheet to turn them into HTML documents that share similar elements.

You could use PHP or another server-side language to generate the pages, and then use a recursive download tool (such as wget) to turn them into HTML.

EDIT: you're basically asking whether the "standard-ish" subset of HTML supported by your component of choice provides a way of including data from a common file, just so you won't have to include the data in every HTML document.

The answer hovers somewhere between "no way" and "maybe your component has a few tricks to do that".

The sane thing to do here would be to have a tool generate the HTML documents from a common template. Could be XML + XSLT, PHP/ASP/whatever, or a fully-fledged CMS (this actually helps let non-technical users write the document contents).

Victor Nicollet
See extra info above.
Jules
A: 

It's awful, but you could include a JS file that uses a bunch of document.write("...") to include common elements. Not SEO friendly.

Diodeus
Couldn't I use document to add file content ? See extra info above.
Jules
@Jules, if you are not using a web server, you can only use client side scripting, so this JavaScript option should work with a web object. If not, you'll have to read different pieces and create only one output. There are no other options...
Alex Angelico