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 ,@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 ?
thanks for any help
On Thu, 09 Sep 2004 18:06:37 +0200, Nicolas Lamirault lam@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 ,@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.
html-template-devel@common-lisp.net