[ZPT] Templates - Automatic Navigation

Dieter Maurer dieter@handshake.de
Mon, 17 Dec 2001 21:17:50 +0100


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