[Templates] Beginner Question: A way around absolute paths?

Kip Lawrence kip@jkcrafts.com
Thu, 16 Oct 2003 00:41:01 -0600


Hi,

I'm a beginner when it comes to the template-toolkit. Could someone
please look at the problem I'm having and offer a suggestion on how to
best overcome my problem.

I am trying to decide how best to write my templates. Currently I have
three files... header, footer, and index.tt2. The extension .tt2 is
routed to Apache::Template.

The problem I am having is that no matter what I try the following
index.tt2 file does not work:

----------
[% PROCESS header %]

Hello World!

[% PROCESS footer %]
----------

In the Apache error_log I see the following:

----------
[error] access to
/home/httpd/sites/d/e/devstore.pmgmentors.com/index.tt2 failed for
000.000.000.000, reason: file error - header: not found
----------

If I put the full path to the files (/path/to/header and
/path/to/footer) in index.tt2 things work just fine.

Unfortunately, I need this template to work anywhere. I want to be able
to copy the three files to any Virtual Host directory and not have to
change the paths in the template.

Could someone please offer advice of what I am doing wrong or a good way
around this problem?

Thank you,
Kip