[Zope3-Users] Re: Introducing z3c.form - widget snippets
Marius Gedminas
mgedmin at b4net.lt
Fri Jul 13 13:34:48 EDT 2007
On Fri, Jul 13, 2007 at 12:42:55PM -0400, Stephan Richter wrote:
> > So, in my snippet-way, it looks like that for every widget:
> >
> > <span replace="structure view/widgets/mywidget/snippets/foo" />
Too many slashes! My brain is exploding.
> > And in the macro-style? Perhaps like that?
> >
> > <span metal:use-macro="snippets/foo">
> > <span metal:fill-slot="snippet">
> > <span replace="structure view/widgets/mywidget/render />
> > </span>
> > </span
>
> This is overcomplicated. If I remember correctly, you can do:
>
> <tal:block define="widget view/widgets/mywidget">
Almost. You need a nocall: there
<tal:block define="widget nocall:view/widgets/mywidget">
> <span metal:use-macro="macro:snippet" />
It's the first time I see 'macro:' in TALES expressions. Interesting.
> </tal:block>
>
> Also, if you do not like macros, you can register simple views to have:
>
> <span replace="structure view/widgets/mywidget/foo" />
>
> For me the cost of the snippet is too high:
>
> 1. It introduces a new pattern for cases that are well-covered otherwise.
> 2. It requires a new directive.
>
> But as I said before, you should publish your work and see how people like it.
FWIW I'm with Stephan on this one. Too many new concepts.
Marius Gedminas
--
A computer without Windows 9x is like a fish without a bicycle.
-- With apologies to Gloria Steinem
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20070713/0e3b864e/attachment.bin
More information about the Zope3-users
mailing list