Server Side Include (SSI) Include Help

Discussion in 'HTML' started by newsgroups@bandwood.com, Dec 12, 2006.

  1. Guest

    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.
     
    , Dec 12, 2006
    #1
    1. Advertising

  2. Andy Dingley Guest

    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?)
     
    Andy Dingley, Dec 12, 2006
    #2
    1. Advertising

  3. Guest

    Andy Dingley wrote:
    > 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.
     
    , Dec 12, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dennis Marks

    SSI Include

    Dennis Marks, Apr 27, 2004, in forum: HTML
    Replies:
    8
    Views:
    523
    Dennis Marks
    May 1, 2004
  2. QA
    Replies:
    2
    Views:
    5,176
    Greg Hewitt-Long
    Sep 12, 2004
  3. Replies:
    10
    Views:
    752
  4. Replies:
    0
    Views:
    350
  5. Henry
    Replies:
    7
    Views:
    139
    Sherm Pendley
    Dec 12, 2003
Loading...

Share This Page