[Bese-devel] TAL template searching problem

Jan Rychter jan at rychter.com
Wed Oct 18 15:45:06 UTC 2006


>>>>> "Ralf" == Ralf Mattes <rm at mh-freiburg.de> writes:
 Ralf> On Wed, Oct 18, 2006 at 01:39:06PM +0200, Attila Lendvai wrote:
 >> >
 >> >updating yaclml. So, how about making the following change, please?
 >> >
 >> >{ hunk ./src/tal/handlers.lisp 89
 >> >- `(funcall (load-tal ,generator ,(merge-pathnames template-name
 >> >*tal-truename*))
 >> >+ `(funcall (load-tal ,generator ,template-name)
 >> >}
 >> >
 >>
 >> this means that the tal include will not be processed as a relative
 >> path to the tal file's location. i wouldn't like that, but as i'm
 >> not using tals i leave the decision for others.

 Ralf> I would _hate_ that! Why would one want this? So we have to touch
 Ralf> every single TAL file every time we move an instance from
 Ralf> development to production?  No template system i know of usess
 Ralf> file system absolute paths.

Er, no, I don't think anyone mentioned using absolute paths in TAL
files. What I do is this:

(setf (ucw::application.tal-generator *my-web-application*)
      (make-instance 'yaclml:file-system-generator
		       :cachep t
		       :root-directories 
		       (list (merge-pathnames "templates/" *site-data*) *site-data*))

Which lets me use tal includes much as one would do #include <header.h>
in C:

<tal:include tal:name="footer.tal"/>

with footer.tal living somewhere in the TAL search path, as defined by
:root-directories.

I thought that was how one is supposed to use it? Sorry for the
confusion if I'm wrong here.

Relative paths don't do the trick for me, as I tend to move documents
(tal templates) around. If I do, relative paths will break. And without
the change mentioned above, the :root-directories list will not work.

--J.



More information about the bese-devel mailing list