[Zope] Re: [ZPT] Structural Logic: Really, It Is...

beno zope@thewebsons.com
Sun, 06 Oct 2002 16:53:16 -0400


At 09:43 PM 10/6/2002 +0200, you wrote:

>Hi Beno,
>
>  [....]
>  > >
>  > >  Ever heard of the "tal:attributes" tag? You should be able to write
>  > >something like:
>  > >  <img width="204" tal:attributes"width python:here.sizeCalc(204,
>  > >here.size(None, context))" src=..." />
>  >
>  > Yeah, heard of it, but this is my first time around. I tried this code:
>  >
>  > <font style="font: 
> tal:attributes='python:here.sizeCalc(44,here.size(None,
>  > context))'" >
>  > This is Page Template <em tal:content="template/id">template 
> id</em>.</font>
>
>  >
>  > and it didn't render as I'd hoped. What am I missing?
>
>The "tal:attributes" must be an HTML-attribute of the surrounding
>tag. It must not be within the value of another attribute, where it will
>be ignored. That seems to be the cause it does not work.
>
>  So instead of:
><font style="font: 
>tal:attributes='python:here.sizeCalc(44,here.size(None,  context))'" >
>
>  which most probably will not be changed if rendered by ZPT, You may try:
><font style="font' tal:attributes="style 
>python:here.sizeCalc(44,here.size(None,  context))" >

I've tried several variations of this *except* the one you specify because 
after the second *font* you have syntax that must be a typo: a single quote 
that isn't closed elsewhere and the HTML requires a colon there. At any 
rate, I've had no success. Please be patient and tell me once again...
beno


>please also note that tal:atributes="..." are enclosed by double quotes;
>after this first the name if the attribute to be changes follows, then
>the expression calculation the attribute. If there is more than one
>attribute to be changes, separate them by semicolon in the
>tal:attributes value (it just works like tal:define).
>
>thats all to know.
>clemens