[Zope] ZPT macro using a macro from the same page template

Gilles Lenfant gilles@pilotsystems.net
Wed, 23 Jul 2003 12:15:54 +0200


----- Original Message -----
From: "Dieter Maurer" <dieter@handshake.de>
To: "Gilles Lenfant" <gilles@pilotsystems.net>
Cc: <zope@zope.org>
Sent: Tuesday, July 22, 2003 11:31 PM
Subject: Re: [Zope] ZPT macro using a macro from the same page template


> Gilles Lenfant wrote at 2003-7-22 15:44 +0200:
>  > I made an all purpose widget macros collection template, and one macro
from
>  > the template is used by another one.
>  >
>  > Is there a kind of shortcut to tell the main macro that the secondary
macro
>  > is defined in the same template ?
>  >
>  > <div metal:define-macro="aux">
>  > </div>
>  > <div metal:define-macro="main">
>  >   <div metal:use-macro="xxx/aux">
>  >   </div>
>  > </div>
>
> Unfortunately not.
>
> I consider this a major drawback as it prevents the definition
> of macro libraries.
>

Hi Dieter,

Agree.
IMO, some "thistemplate" like global variable in TALES expressions would fix
this in an elegant way. But dunno if this is an easy work.
Gonna find the "wish list" for ZPT :o)

>
> Nowadays, we almost always use ZPT through CMF's "portal_skins".
> Therefore, "container" is the portal and we access
> the ZPTs via "container/ZPT_id".

Making something like this in CMF/Plone but this goes through the
acquisition machinery to find the page template itself. The above stated
solution would do this faster.

And I sometimes make stuff with no CMF/Plone :o)
Cheers

--Gilles