[Zope3-dev] Re: tal:define="..." considered harmful?
Max M
maxm at mxm.dk
Sun Feb 12 13:18:51 EST 2006
kit BLAKE wrote:
> In 'normal' tal we often refactor our defines to improve efficiency.
> When something is called more than once in a template, we define it at
> the beginning, and then use it multiple times. This improves
> performance dramatically of course.
> kit
On another note, I think that tal:define="" is the ugliest part of zpt.
If only it was possible to define which attributes could be set by a tal
expression, and then put the tal into the attribute itself, I would be
happier.
So instead if this:
<a href="#"
tal:attributes="href here/absolute_url;
title here/title;
id here/getId"
tal:content="here/Title">Title</a>
I could write this:
<a href="here/absolute_url" id="here/getId" title="here/Title"
tal:attributes="href; id; title"
tal:content="here/Title">Title</a>
All that would be needed for this syntax, is if an attribute in
tal:attributes didn't have a definition, it would look in the attribute
itself for the tal.
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
More information about the Zope3-dev
mailing list