[ZPT] Re: macros and contexts
Chris Withers
chrisw at nipltd.com
Tue Sep 16 03:13:12 EDT 2003
Dieter Maurer wrote:
> Chris Withers wrote at 2003-9-15 13:07 +0100:
> > Seb Bacon wrote:
> > > Just to follow up, the solution I have thought of so far is to redefine
> > > the value of 'here':
> > >
> > > <div tal:define="here nocall:here/foo">
> > > <div metal:use-macro="here/widgetlib/macros/widget_1_view">
> > > Widget 1 view goes here
> > > </div>
> > > </div>
> > >
> > > Which is pretty nasty, but really seems to be the only solution...?
> >
> > Why is it nasty? It is, after all, exactly what you're looking to do ;-)
>
> It breaks abstraction...
>
> In the widget library you do not know (and you should not know)
> what "here" is and you should not make assumptions about it.
Add the code Seb is using does exactly that from what I can see. The only
assumption being made is that "here" is the current object that this piece of
ZPT needs do deal with.
What leads you to feel differently?
Chris
More information about the ZPT
mailing list