What's behind this ?

Actually, we get the "template" variable available in the TALES namespace.
"template", when used in a macro, refers to the template that uses the
macro, and not to the template that contains the macro.

The future (if you wish it with me) "thistemplate" variable will refer to
the template that contains it, whatever that template is being refered or

Example of use : nested macros in a widgets collection template

<metal:widget metal:define-macro="basicwidget">
<metal:widget metal:define-macro="extendedwidget">
 <metal:inner metal:use-macro="thistemplate/macros/basicwidget">

Actually, if you need nested macros in the same template, you need to refer
that nested macro with...


1/ using directly "thistemplate" is more legible and maintainable.

2/ you can rename more safely the templates.

3/ you can put and use attributes in templates that contains only macros.

4/ accessing "thistemplate" would not involve the acquisition machinery to
find inner resource. Thus provide the invoked resource (other macro) much

Any comment ?



Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to