Re: How to "insert text by reference" (display text content from other files)

by "Ted Temer" <temer(at)c-zone.net>

 Date:  Mon, 14 Aug 2000 09:16:45 -0700
 To:  "HWGBASICS" <hwg-basics(at)hwg.org>
 References:  JaySmith
  todo: View Thread, Original
Jay:

To elaborate on what Jennifer said, here is a copy of a reply I made a
couple of weeks ago that contains a little more detail.

In this case, the question referred to a file that would be inserted at the
bottom of each page and be called a "footer". The principle is the same, no
matter where the insertion point is located.

<<<Paste from earlier post >>>>

Assuming you want the same "footer" information on every page--or at least,
many pages--the simple way is to use an include file:

<!--#include virtual="name-of-file.txt"-->

The .txt may be almost any kind of file--even another HTML file or even a
graphic. You put the above "call" where you want the file to appear. Be
aware that this is a SERVER SIDE gizmo. (SSI) Therefore, unless you are
running a server properly equipped on your desktop machine, you may have to
upload the page before the Include file will work.

Also--If your include file is not in the same folder, (directory) as your
pages, then you will have to name the "path" to that file in the tag above.
That's kind of why the word "virtual" is part of the tag. If your include
file is in the same folder as the pages, then supposedly, the word virtual
could be omitted.

Using include files may also require the use of a different extension for
your pages. Instead of .htm or .html, you may have to use .shtml on Apache
servers or .stm on NT servers. This tells unenlightened servers to look for
the include statement and supply the proper file.

This is not true of ALL servers though. Some ISP's actually do provide the
service of taking the five minutes or so to set their .haccess files (or
Registry on NT's) to allow the use of normal pages. (Others claim horrendous
server overload, etc. but most articles on this subject agree that such
claims made when servers had a "clock speed" of single digits, are now
unjustified.)

I sadly suspect that this "server overload" subject, could also start a
"war".

Best wishes
Ted Temer
Temercraft Designs Redding, CA
temer(at)c-zone.net
www.temercraft.com/
www.newsredding.com/


> Greetings,
>
> This is probably a really dumb question in the HTML environment, but
> what I seek to do is a common everyday function in the print
> publishing world where I do a lot of work.
>
> I want to make HTML pages that get part of their TEXT content from
> other pages/files.
>
> Essentially I want to do the same thing with TEXT that one can do with
> images.
>
> In the current case, I want to bring in various blocks of "boiler
> plate" text into dozens of files, but I wish to maintain each block of
> that text in only one location, respectively.
>
> I know that this has to be possible, but I can't find any reference to
> it and searching my personal archive of this newsgroup has not yielded
> an answer. It could be that I just don't know what keyword I need to
> be searching for.
>
> Jay
>
> --
> Jay Smith
>
> e-mail: Jay(at)JaySmith.com  mailto:Jay(at)JaySmith.com
> website: http://www.JaySmith.com

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA