[ZPT] Including data from ZSQL method in src: attribute

robert robert at redcor.ch
Thu Aug 28 21:12:39 EDT 2003


Am Thursday 28 August 2003 17:44 schrieb Mitch Pirtle:
> Hi list,
>
> A little snag here, I'm looping through the results of a query that
> includes first_name ('Mitch') and mugshot ('mitchy.jpg').
>
> The concept I currently fail to grasp is how to insert the value of
> mugshot in the src attribute.  The value of mugshot is just a pointer to
> images ("media/mitchy.jpg" in the example).  I've coded it thusly:
>
> <table>
>   <tr repeat="row here/listEmployeeDetails">
>     <td><img tal:attributes="src string:${portal_url}/media/?"></td>

<img tal:attributes="src python:'%s/media/%s' % (portal_url,row.mugshot)">

>     <td><span tal:content="row/first_name">First</span></td>
>   </tr>
> </table>
>
> The "?" is where I want the values from mugshot.  How is this done?
>
> -- Mitch
>
>
> _______________________________________________
> ZPT mailing list
> ZPT at zope.org
> http://mail.zope.org/mailman/listinfo/zpt

-- 
mit freundlichen Grüssen

Robert Rottermann
www.redCOR.ch




More information about the ZPT mailing list