[html-template-devel] question about *default-template-pathname*

Edi Weitz edi at agharta.de
Fri Sep 10 11:31:47 UTC 2004


On Thu, 09 Sep 2004 18:06:37 +0200, Nicolas Lamirault <lam at tuxfamily.org> wrote:

> i use html-template in 2 projects
> i have a macro like this :
>
> (defmacro print-template ((page) &body body) 
>   `(ml:output-html-page 
>     (with-output-to-string (stream) 
>         (let ((*default-template-output* stream) 
>               (tp (create-template-printer ,page))
>               ...
>           (fill-and-print-template tp 
>                                    (list :title tile
>                                          :author author 
>                                          , at body)))))))
>
> and i have a start function which have an argument to set
> default-template-pathname*, like this :
>
> (start-project "/location/of/templates/" file-config)
>
> and in start-project :
>
> (setf html-template:*default-template-pathname* template-dir)
>
> but i have a problem when my 2 projects are loading
> because each one modify *default-template-pathname*
>
> is there a possibility to have a default template directory 
> for each project ?

Well, it's a special variable. Why don't you rebind it with LET
instead of changing its value with SETF? That should do the trick.

Cheers,
Edi.




More information about the Html-template-devel mailing list