accessing Photo object indirectly via property value
I want to display an image with the link to a child Photo Folder. The folder has a property "image" which contains the name of the image file to use. This is how I'm doing it now: <dtml-in expr="objectValues('Photo Folder')" sort="id"> <dtml-unless private> <a href="&dtml.url-sequence-item;"> <img src="&dtml.url-sequence-item;/<dtml-var image>/?display=icon" alt="image" /> </a> <a href="&dtml.url-sequence-item;"> <dtml-var id> </a> </dtml-unless> </dtml-in> Is this the recommended way or are there some better ways to do this: "&dtml.url-sequence-item;/<dtml-var image>/?display=icon" Best Regards, Rob _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
On Saturday 13 April 2002 20:15, Rob Lemley wrote:
"&dtml.url-sequence-item;/<dtml-var image>/?display=icon"
Sure. Fine. More pythonic though would be: <dtml-var "_.getitem(image).display('icon')"> or <dtml-var "_.getitem(image).tag(display='icon')"> Doing it that way consumes more processing power but wrapping it around IFs or TRY statements you can avoid photo objects that don't work. Peter
Best Regards, Rob
_________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (2)
-
Peter Bengtsson -
Rob Lemley