[Templates] Relative paths
Jonas Liljegren
jonas@paranormal.se
Wed, 16 Aug 2000 14:56:23 +0200 (CEST)
More bugs/feature requests.
In the TT2 documentation, it says for INSERT:
The filename specified should be relative to one of the INCLUDE_PATH
directories.
And for INCLUDE:
If a BLOCK definition is not currently visible then the template name
should refer to a filename relative to one of the INCLUDE_PATH directories
And PROCESS:
The PROCESS directive is similar to INCLUDE but does not perform any
localisation of variables before processing the template.
ISSUE ONE
=========
But then I try to use a path relative to my INCLUDE_PATH..
[% PROCESS '../site/front.html' %]
I get the response:
../site/front.html: relative paths are not allowed (set RELATIVE option)
This is a contradiction. Paths relative to the INCLUDE_PATH works if they
are of the form path/to/template, but not if they say ../path/template. I
think that '..' should be allowed.
ISSUE TWO
=========
The RELATIVE option is for searching for templates relative to the current
directory. Would anyone realy want to use that option?
a) The program could be started from a random location. But you often
expect the current directory to actualy be the directory of the
program itself. Or at least; it would be more useful to use the
program directory as base, rather than the current directory.
b) The program can change the current directory.
c) Isn't the natural inclination to use filenames relative to your
current location? That is; to say where a template is located in
relation to the template that includes the file. Or relative to the
program, if you are about to process a named template.
ISSUE THREE
===========
The manual does not say that you don't have to quote the filname in a
INCLUDE or PROCESS directive. But it do say it for the INSERT directive:
For convenience, the filename does not need to be quoted
as long as it contains only alphanumeric characters,
underscores, dots or forward slashes. Names containing
any other characters should be quoted.
This is hovever not correct. If I try:
[% INSERT ../test/t2/banner.html %]
I get the error:
parse error: start.html line 4: unexpected token (..)
In spite of the RELATIVE option set to true.
One last thing. Then does TT2 beta 4 come out? ;-)
--
/ Jonas - http://jonas.liljegren.org/myself/en/index.html