[Zope] Attributes

Paul Winkler pw_lists@slinkp.com
Wed, 18 Jun 2003 12:04:22 -0400


On Wed, Jun 18, 2003 at 08:05:06PM +0100, Simon Forster wrote:
> This should be simplicity itself but I've read and re-read what the 
> Zope book has to say on this and I don't understand...
> 
> <img src="../images/ldmlMenu_01.png" width="170" height="2" border="0" 
> tal:attributes="src here/images/ldmlMenu_01.png">
> 
> should, if my understanding is correct, replace the src attribute for 
> the image with the path defined by the tal:attributes statement. My 
> understanding is wrong because I get:
> 
> <img src="&lt;img 
> src=&quot;http://127.0.0.1:8080/ldml/images/ldmlMenu_01.png&quot; 
> alt=&quot;&quot; title=&quot;&quot; height=&quot;2&quot; 
> width=&quot;170&quot; border=&quot;0&quot; /&gt;" width="170" 
> height="2" border="0">

yup. when you call the image, you get a complete img tag.
And when you insert text in tal, it gets quoted unless you use 
"structure".  So you could do a couple of things:

1. Get the url instead of the complete tag:

<img src="../images/ldmlMenu_01.png" width="170" height="2" border="0" 
 tal:attributes="src here/images/ldmlMenu_01.png/absolute_url">

2. Use the complete tag:

<img src="../images/ldmlMenu_01.png" width="170" height="2" border="0" 
 tal:replace="structure here/images/ldmlMenu_01.png">

or

<img src="../images/ldmlMenu_01.png" width="170" height="2" border="0" 
 tal:replace="structure here/images/ldmlMenu_01.png/tag">



-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's YET ANOTHER TITANIUM BONER ELECTROCUTOR!
(random hero from isometric.spaceninja.com)