[ZPT] extended path notation
ethan mindlace fremen
mindlace@digicool.com
Fri, 06 Jul 2001 16:04:27 -0400
I'm doing a fair amount of PT lately. In my main_template, I have
probably 60 or so image references. Some of these are "stand alone"
images, and some of them are in background tags. Some are also links.
So I have to do this:
<td background="dark_grey_bg.png" tal:attributes="background
here/dark_grey_bg.png/absolute_url">
and:
<img src="button.png" tal:replace="structure
python:('here/button.png').tag(border='0')">
mostly, i think the fault lies with the image object, but I have two
suggestions:
1. allow objects to suggest the attr's they'd like to provide.
<img src="logo.png" border="0" tal:attributes="here/logo.png/attrs">
would replace the src attr and add width and height attrs, but leave
"border" alone.
2. extend path notation to include variables:
<img src="logo.png" tal:replace="structure here/logo.png?border=0">
both could be handy, but the latter might be more used in non-image
contexts.
~ethan