[Zope] getting image for a repeat item

Jim Penny jpenny at universal-fasteners.com
Fri Jan 30 15:07:49 EST 2004


On Fri, 30 Jan 2004 14:03:18 -0500
Kevin Worth <kworth at engin.umich.edu> wrote:

> Hello-

> 
> How would I get the image from the photos folder to display, so that 
> it will get the correct photo?
> 
> I can use <img src="dummy.jpg" width="120" tal:attributes="src 
> string:${root/photos/Kevin_Worth/absolute_url}">   to get my picture 
> for everyone, but I need to know how to replace Kevin_Worth with the 
> firstname_lastname of the repeat element.
> 

Using python syntax:
 <img tal:attributes="src
   python:'%s/photos/%s_%s/absolute_url'%(root.absolute_url(),
    adminstafflist['first_name'], adminstafflist['last_name'])">

Or, 
  <img tal:attributes="src
    python:path('root/photos/%s_%s/absolute_url'%
    (adminstafflist['first_name'], adminstafflist['last_name']))">

You may also be able to use the string: TALES option.

Jim Penny

> Thanks for any pointers.
> 
> Kevin
> 
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
> 
> 



More information about the Zope mailing list