[ZPT] Templates - Automatic Navigation

Sam Collett Sam.Collett@gp-b81091.trent.nhs.uk
Tue, 18 Dec 2001 09:42:19 -0000


I have tried:

<li tal:repeat="example python:here.objectValues('Folder')">

But when 'here' is used it does not mean the master template, but the
template it is being called by.
Basically I want it to list all folders in the folder Test. How do you list
folders in a certain directory (not from the folder the template is in)?

-----Original Message-----
From: Dieter Maurer [mailto:dieter@handshake.de]
Sent: 17 December 2001 20:18
To: Sam Collett
Cc: ZPT List (E-mail)
Subject: Re: [ZPT] Templates - Automatic Navigation


Sam Collett writes:
 > What is wrong with the following?
 > 
 > <ul>
 >       <li tal:repeat="example python:BASE2.objectValues('Folder')">
 >         <a href="example"
 >            tal:attributes="href example/getId"
 >            tal:content="example/title">Example Title</a>
 >       </li>
 >     </ul>
What did it tell you when you tried?


There are lots of problems with the code above:

  *  "BASE2" instead of "request.BASE2"

  *  "BASE2" is a string not an object! It does not have a
     method "objectValues".

     Use "request.PARENTS[-2]" (but, I read "PARENTS" were deprecated)

  *  the relative "href" link will probably be not correctly resolved
     use "href	example/absolute_url".


Dieter