Click here to get back home

Server Side Include (SSI) Include Help

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Server Side Include (SSI) Include Help newsgroups 12-12-2006
Get Chitika Premium
Posted by newsgroups on December 12, 2006, 12:18 am
Please log in for more thread options


What I'm trying to do is for each page I want to have a dynamic include

that is derived from the current document name.

Example, for a page named foo.shtml I want to derive the following
include statement:


<!--#include virtual="/foodir/foo_incl.htm" -->


So <!--#echo var="DOCUMENT_NAME" --> gives me the filename (foo.shtml)
and what I need to do is take the foo bit and append _incl.htm to give
foo_incl.htm and then use this in an SSI include.


Any help most welcome and appreciated.


Posted by Andy Dingley on December 12, 2006, 5:42 am
Please log in for more thread options



newsgroups@bandwood.com wrote:

> What I'm trying to do is for each page I want to have a dynamic include

Don't. If you do this (and it's possible, although not with PHP) you
will badly affect the server's ability to cache the merged document,
thus affecting performance.

> that is derived from the current document name.

That's a static include then, not dynamic. The document doesn't change
name very often, does it? Strictly it's a large number of individual
static includes, one per document. No connection between them, but
they're not dynamic.

> Example, for a page named foo.shtml I want to derive the following
> include statement:
> <!--#include virtual="/foodir/foo_incl.htm" -->

Then set your documents up like this manually. It's very easy, just a
little time consuming. Personally I have a good editor, so it would be
no big deal. If you really have thousands to deal with, write a line or
two of Perl to process them for you.

I'm also puzzled as to why you need such an include. It's certainly
possible to do it, just odd as to why includes (usually a mechanism for
sharing common code) need to be used here to embed a lot of distinct
documents in other distinct documents ? Why not just paste the content
directly in? Could you embed foo.html inside foo_incl.html instead
(assuming foo_incl changes by some data export process and foo doesn't
as it's just a header?)


Posted by newsgroups on December 12, 2006, 2:36 pm
Please log in for more thread options



Andy Dingley wrote:
> newsgroups@bandwood.com wrote:
>
> > What I'm trying to do is for each page I want to have a dynamic include
>
> Don't. If you do this (and it's possible, although not with PHP) you
> will badly affect the server's ability to cache the merged document,
> thus affecting performance.
>
> > that is derived from the current document name.
>
> That's a static include then, not dynamic. The document doesn't change
> name very often, does it? Strictly it's a large number of individual
> static includes, one per document. No connection between them, but
> they're not dynamic.
>
> > Example, for a page named foo.shtml I want to derive the following
> > include statement:
> > <!--#include virtual="/foodir/foo_incl.htm" -->
>
> Then set your documents up like this manually. It's very easy, just a
> little time consuming. Personally I have a good editor, so it would be
> no big deal. If you really have thousands to deal with, write a line or
> two of Perl to process them for you.
>
> I'm also puzzled as to why you need such an include. It's certainly
> possible to do it, just odd as to why includes (usually a mechanism for
> sharing common code) need to be used here to embed a lot of distinct
> documents in other distinct documents ? Why not just paste the content
> directly in? Could you embed foo.html inside foo_incl.html instead
> (assuming foo_incl changes by some data export process and foo doesn't
> as it's just a header?)

Trust me I do need it. You point on caching is very valid and I'd not
thought of that side-effect. I'll jyst manually add them,

Thanks for your post and advice.


Similar ThreadsPosted
Strange behavior with Service Side Include July 31, 2008, 5:32 pm
How can I "include" an HTML file from another server? March 18, 2006, 11:51 am
Why didn't the include work? April 6, 2007, 8:12 am
HTML include? April 8, 2007, 6:15 am
Embed/Include in HTML ... is it possible ? September 9, 2004, 5:09 pm
Need unique ids using include file April 8, 2008, 6:41 am
How to point to other URL's with #include command? January 31, 2006, 1:10 pm
RSS: author must include an email address February 20, 2006, 1:21 pm
newbie: include navigation file without ssi? August 8, 2006, 10:43 am
Error trying to include an image or css file? October 25, 2006, 8:48 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap