I'm wondering how to do the equivalent of an "include".
I want to use just HTML and CSS. (I can see how to
do it with ecmascript.)
I have HTML for a header in a file that I'd like to "include"
in a dozen documents. I tried the OBJECT element but it seems to have a
different purpose.
i. I'd like the HTML for the header to simply be incorporated
into the parse tree of the document
ii. I would like the document's CSS to apply to the included
header.
I am happy to work with OBJECT if that's the way to
go, but I would like the result to be just as if (i)
and (ii) were taking place. How?
Thanks,
Alan Isaac
PS I hope not to do a server side include for two reasons.
1. I (take it that) I cannot view the result when I'm
working offline.
2. It seems to cede control to the people who are running
the server, which may or may not support includes for all
I know.
> I'm wondering how to do the equivalent of an "include".
> I want to use just HTML and CSS. (I can see how to
> do it with ecmascript.)
Then check the FAQ, that's what it's for:
<URL:http://www.htmlhelp.org/faq/html/design.html#include-file>
--
Jim Dabell
> I'm wondering how to do the equivalent of an "include".
> I want to use just HTML and CSS. (I can see how to
> do it with ecmascript.)
What you're really looking for is an HTML preprocessor of some sort.
Two that spring into mind are htmlpp and PPWizard.
<URL:http://www.imatix.com/html/htmlpp/>
<URL:http://www.labyrinth.net.au/~dbareis/ppwizard.htm>
--
Arve | http://www.bersvendsen.com/ | http://www.virtuelvis.com/
Lyd i nettbasert reklame? Nei takk!
http://www.bersvendsen.com/stillhet/
On Fri, 13 Jun 2003 20:13:06 +0100, Jim Dabell <jim-u...@jimdabell.com>
wrote:
> Then check the FAQ, that's what it's for:
> <URL:http://www.htmlhelp.org/faq/html/design.html#include-file>
In principle yes.
It said to try OBJECT.
So I did.
Please see the problems raised in my post.
Specifically, the document's CSS is not applied.
And just to anticipate, suppose you say just make the header snippet into a
complete
document and use the same CSS file...
ack, even as I write this I see the solution
to that problem.
Close enough.
Alan
Please see the FAQ again, you don't seem to have read anything but the first
couple of sentences:
Sorry, but I'm missing your point.
Recall my first post warned this was a newbie question.
I do not see anything that responds to the questions
I raised as I raised them. If you are referring to
server-side includes, please see my earlier addendum.
If not, please offer a clue.
Thanks,
Alan Isaac
The key paragraph:
"Two popular ways of including the contents of one file seamlessly into
another for the WWW are preprocessing and server-side inclusion. A
preprocessor converts its source into a plain HTML document that you
publish on your server. In contrast, documents that use server-side
inclusion are processed every time the document is retrieved from the
server."
It then supplies you with some useful links so you can get the software you
need.
Arve also mentioned preprocessors. Basically, you write documents that
contain mostly HTML, and a few special bits that say "include this file
here". You then run the preprocessor over a bunch of documents, and you
end up with normal HTML, with all the includes already done. You then
upload the files.
As the FAQ mentions, the only ways of doing "includes" in plain HTML are
with <object> or frames, which have their drawbacks.
--
Jim Dabell
> PS I hope not to do a server side include for two reasons.
Any client-side approach that you might devise has even worse
implications, though.
> 1. I (take it that) I cannot view the result when I'm
> working offline.
You haven't chosen to tell us what OS you would be using offline, but
if it's any plausible flavour of Windows or some unix-ish OS then
you'd be recommended to install Apache on your developlment platform,
and set it so that it allows access from localhost (it's safest to
deny remote access if you're using it solely for test purposes).
This can be beneficial in all kinds of ways; SSI is only one of them.
> 2. It seems to cede control to the people who are running
> the server, which may or may not support includes for all
> I know.
Well, I'd partly agree with what you say, but SSI isn't an
unreasonable facility to ask for if you're in the least serious about
web page serving. PHP is also rather widely available on web hosts,
and that offers even more possibilities.
No, the bigger problem with SSI "per se" is that it sends out its
pages without the usual "freshness validators". This inhibits
cacheing to various degrees, in clients as well as in any shared proxy
caches that might be involved.
See Mark Nottingham's classic tutorial http://www.mnot.net/cache_docs/
, but the consequences can be readily avoided by using the "XBitHack
full" directive, as he shows.
good luck
> Arve also mentioned preprocessors. Basically, you write documents that
> contain mostly HTML, and a few special bits that say "include this file
> here". You then run the preprocessor over a bunch of documents, and you
> end up with normal HTML, with all the includes already done. You then
> upload the files.
This is a perfectly respectable way of doing it, indeed; the fact that
I omitted to mention it in my previous followup was not intended to
suggest to the O.P that there was anything wrong with a preprocessor
approach if it was otherwise applicable (e.g didn't involve rapidly
changing content).
> As the FAQ mentions,
Certainly the one-off answers in this thread should be taken in
conjunction with the advice in that FAQ!
Using "make" and an appropriate Makefile to co-ordinate the various
activities of checking for changed content, running the appropriate
preprocessor on the relevant dependent files, and uploading them to
the server, can be a powerful and convenient-to-use technique, once
set up. Unfortunately, "make" is such a potentially powerful tool
that even the simpler documentation and tutorials can seem daunting to
a beginner. I don't have a good answer to that, sorry - if anyone
else can suggest a tutorial or recipe book then speak up! ;-)
cheers