On Sat, 20 May 2000, Joshua Chamas wrote:

> Use file includes.  virtual includes are meant to execute
> anything and include its output, and is handles by Apache::SSI
> outside of Apache::ASP. File includes will be executed as perl 
> asp subroutines in the same perl namespace as the 
> including script.

I see. There are two problems that I have with file includes though:

(1) I cannot specify a file's location relative to $ENV{'DOCUMENT_ROOT'}.

(2) I cannot specify a file's location relative to the directory the
current file is in.

For #1, I want to do something like this in all my pages:

<!--#include virtual="/code/header.asp"-->
<!--#include virtual="/code/footer.asp"-->

And for #2, I have an "index.inc" in all my directories. Each index.inc
has to include the one in its parent directory, e.g.:

<!--#include file="../index.inc"-->

so that directories can pass on properties to their subdirectories. If I
use include file for that, it will include files relative to the pathname
of the first ASP file, and not relative to the pathname of the ASP file
that actually has the include.

One reason I'm coding like this is because I want to give each directory a
title and append it to the page's <title>. e.g.:

http://www.girlsofanime.com/series/slayers/lina/ has title of
Girls of Anime::Anime Series::The Slayers::Lina Inverse

The way the title is constructed is:

In /index.inc: $title = 'Girls of Anime';
/series/index.inc: $title .= '::Anime Series';
/series/slayers/index.inc: $title .= '::The Slayers';
/series/slayers/lina/index.inc: $title .= '::Lina Inverse';

Is there a better way I can do this? Right now I'm thinking of either
trying to hack Apache::ASP to support #include virtual, or using absolute
pathnames or trying to put $ENV{'DOCUMENT_ROOT'} in the file path.

-Philip Mak ([EMAIL PROTECTED])

Reply via email to