[Zope] Dynamic Navigation with ZPT

Geir Bækholt Geir Bækholt
Thu, 3 Apr 2003 10:40:21 +0200


On  Wed, 2 Apr 2003 21:42:40 -0500 GMT (..4:42 where i live(GMT+1) )
Jamie asked the Zope mailinglist about the following:
  
J> Does anyone know how to create a navigation bar that lists the titles of
J> all folders as links, using ZPT something similar to what this would
J> give me in DTML?
 
J> <dtml-if expr="_.len(PARENTS) > 2">
J> <a href="..">Return to parent</a><br>
J> </dtml-if>
J> <dtml-in expr="objectValues('Folder')">
J> <a href="&dtml-absolute_url;"><dtml-var title_or_id></a><br>
J> </dtml-in></p>

will this do the job ?
untested code:
<p>
<a tal:condtition="python:len(request.PARENTS) > 2" href="..">Return to parent</a>
<a tal:repeat="subfolder python:here.objectValues('Folder')"
   tal:attributes="href subfolder/absolute_url"
   tal:content="subfolder/title_or_id">
   link to subfolder
</a>
</p>

:)

--
Geir Bækholt