[Zope] Re: METAL question: relative reference to a macro defined in
the same file
Tonico Strasser
contact_tonico at yahoo.de
Thu Apr 8 16:37:58 EDT 2004
Johan Carlsson wrote:
>
> Is it possible to refer to a macro defined in the same file
> in a use-macro statement?
>
> Using:
> <div metal:use-macro="template/macros/render_fields"/>
> doesn't work because template is the main template called not
> necessary the one containing the macro and the use-macro.
>
> Using:
> <div metal:use-macro="here/pat/to/the/file/macros/render_fields"/>
> does work but if I move the file I need to change the content,
> and that's bade maintainability in my book :-)
Why do you need to move your templates? Do you move scripts, images and
CSS files as well? Where do you store your content?
You can write a Python script that returns a macro if you want to change
your path dynamically.
Tonico
More information about the Zope
mailing list