Posted by TimJ on Wed Apr 14 15:01:21 1999
In Reply to: Re: Re: Re: Re: paths to templates posted by TimJ on April 14, 1999 at 14:58:50:
Distribution: | paneris@paneris.org |
---|
(this one really is from me)>>In any case I hope Chippy wasn't proposing hardwiring the directory
>>name into 1000 different places in the source :) ?
>
>This confuses me. We have to hardwire the directory name in the
>source where-ever we load in a template anyway, don't we? Oh, are
>you saying that we don't have to do that 1000 times, just 10?
>Certainly true.Also a little confused, the directory needs to be in the code as we require 'namespace' for our templates. Although we can have multiple template directories (specified like a classpath), it doesn't really help as we need the following:
project1/templates/contactform.wm
project2/templates/contactform.wmin production this may not be absolutely necessary as each site is likely to run under it's own vm (and therefor have it's own template path), but we havn't really made this desision yet.
at present we ahave a more-or-less 1:1 relationship between handlers and templates. this will not always hold; a handler may be required to return a different template depending on which project we are. This gets even more complex for the paneris2 site as we will probably write our own template loader that zips up a template tree (like the www.paneris.co.uk)
In fact I now think that we need our own template loader anyway, that does something like the following:
1) look for the template specific to the current project and return it if found
2) otherwise return from a generic template directoryin our handlers, we would then only specify the template name (and no path whatsoever). which is correct.
conclusion: org.webmacro.PanerisTemplateLoader (not sure this is the right name) to be written, and project/templates/template.wm to be used in the meantime.
phew