This is the core of my ZPT thumbnail viewer. I haven't finished it or the 'view' object yet, but I use this bit of code to display my thumbnail views <table tal:define="photos container/PhotoList" align="center" cellpadding="0" cellspacing="5"> <tr tal:repeat="cur python:range(0,len(photos),4)"> <td tal:repeat="item python:modules['ZTUtils'].Batch(photos,size=4,start=cur)" align="center"> <a href="" tal:define="url python:item.getId() + '/view'" tal:attributes="href url"> <p tal:replace="structure python:item.tag(display='thumbnail', border=0, cookie=0)"></p> <br/> <p tal:replace="structure item/title_or_id">title_or_id</p> </a> </td> </tr> </table> The 'PhotoList' object is a pythonscript as follows: return container.objectValues('Photo') This can probably be replaces with a python: thingie ... just haven't done it yet. Hope this helps. On Mon, 2002-09-02 at 16:45, Jochen Haeberle wrote:
Hi,
I am banging my head against the wall trying to figure out how I would best use rbickers Photo-Product from Page Templates, but I guess the problem is the same for any Zope-Product that does not come with ZPT-Support out of the box.
I guess, one can use the Photo product without any real problem, for example, I can do
<a Href="#" tal:attributes="href string:${my_batch/id}/view"> <img src="image.jpg" tal:attributes="src string:${my_batch/id}?display=thumbnail"> </a>
to show the thumbnails of my Photos and link to the "view" method, but is this really TAL???
I am able to call some methods on the PhotoObjects as well like
<ul> <li tal:repeat="displays here/displayLinks" tal:content="structure displays">Link to a size</li> </ul>
To get the links to different size-links...
...but how would I express
<dtml-var "tag(display=REQUEST.get('display', 'small'), border=0, cookie=1)">
in TAL to get the cookie-enabled version of the Photo???
In general, what's the best way to learn how to use existing products in Templates??
Thanks in advance
Jochen
_______________________________________________ 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 )