[ZPT] Problem accessing variables in a path expression

Charlie Clark charlie at begeistert.org
Wed Jul 23 14:21:47 EDT 2003


Dear list,

there must be a better way than this...

I've got a folder of PageTemplates which I'd like to list in a table of 
contents. The contents will change but I would like to be able to affect 
the order of the pages by naming convention = all files are given a number. 
("1", "2", "3", etc.)

If I use context.objectValues() I get an unsorted list back so I've gone for
context.objectItems() which I can sort as the ids are different. This makes 
calling the ids and titles in ZPT pretty ugly.

<span tal:repeat="page python: here.objectValues()">
<a tal:attributes="href python: page[0]" tal:content="python 
page[1].title_or_id()">
</span>

There must be a better way than this

Charlie



More information about the ZPT mailing list