Re: Client-side HTML Includes

by "Steve Mount" <steve(at)saltyrain.com>

 Date:  Tue, 23 May 2000 21:41:25 -0400
 To:  "Andrew Sturmey" <andrew.sturmey(at)deverill.co.uk>,
<hwg-techniques(at)mail.hwg.org>
 References:  PL11
  todo: View Thread, Original
This is what I do.

I have live pages, and template pages.  The template pages reside in a
directory on my server outside of the base web directory, so they are
accessible only directly on the server.  The template pages contain the
unique content of each page.  On a page, I have tags:

[HEADER]
data
content
links
etc
[FOOTER]

I have a Perl script that takes each template page, and translates the
"template tags" into HTML.  The header includes all the stuff you'd expect:
DOCTYPE, head, title, navigation bars, etc.  The footer contains the
copyrighty, disclaimery stuff, and closes the body and html tags.  I can
reformat my entire site in one command to rebuild the live pages from the
templates.

This is not an original idea - my understanding is that FrontPage does
something very similar, as does DreamWeaver, I've heard.  But it suits my
purposes, is quick, easy to understand and modify.  I have the benefits of
frames, with a static "frame" for the header and another "frame" for the
footer, but there are no frames - just the benefits :)  Eventually, I got
tired of logging into the server to generate the live pages, and I wrote a
small script to do it via the web ... the whole system is very extensible,
to whatever my imagination can imaginate.

Hope that helps.

-------------------------------------------------------------
Steve Mount, Software Engineer            steve(at)saltyrain.com
Home Site                            http://www.saltyrain.com
UVM Class of 1989                http://www.saltyrain.com/uvm
US Constitution Online          http://www.usconstitution.net
Manager, HWG Logo Team                     http://www.hwg.org

----- Original Message -----
From: Andrew Sturmey <andrew.sturmey(at)deverill.co.uk>
To: <hwg-techniques(at)mail.hwg.org>
Sent: Tuesday, May 23, 2000 6:20 PM
Subject: FW: Client-side HTML Includes


> Can anyone assist?
>
> I've been asked to design a site.  Three requirements of it that I'm
having
> trouble meeting with a single solution:
>
> - It must be really light on bandwidth.
> - It has to have a chunk of standard navigational stuff at the top of each
> page, and some corporate copyrighty, disclaimery stuff at the bottom of
each
> page.
> - It may not use frames in any capacity.
>
> Ordinarily I'd either put the non-changing stuff in alternate frames to
the
> browsable stuff, or I'd use server-side includes to churn out the same
bits
> at the top and bottom of each page.
>
> Since server-side includes are a no go area as they'd have to be
> retransmitted in each page, I thought a cachable client side include would
> be in order.  Never having done this before I looked to the official html
> specification for answers.
>
> The obvious way to do this looked like using an <OBJECT> tag to include
the
> same two files in each page, but when I did this, I got horrible IFRAMEish
> looking bits appear *groan*.
>
> Any ideas on how I can just include chunks of other pages in a page
without
> having to have kludgy looking bits?

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA