[Zope] Re: METAL question: relative reference to a macro defined in
the same file
Tonico Strasser
contact_tonico at yahoo.de
Fri Apr 9 06:44:31 EDT 2004
Johan Carlsson wrote:
> Mark Gibson wrote:
>
>> 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 :-)
>
>
> Mark and Tonico,
>
> Using Scripts doesn't "make things easier" which is what I wan't.
> But obviously it's not possible with the current METAL/TAL
> implementation, which I (imho) regard as a flaw.
> Refering to the current script file can be useful in many scenarios.
I still do not understand why you want to move your presentation
templates around. If your template is in a folder at the root of your
site, let's say 'templates', you wouldn't need to change the path from
other templates referring to it when you move them.
Tonico
More information about the Zope
mailing list