[ZPT] Apologies about HTML mail: referencing items in a list

Chui G. Tey chui.tey@advdata.com.au
Fri, 2 Nov 2001 17:00:43 +1000


This ought to be simple:

I'm trying to do this:

    <span tal:define=3D"mybookmarks python:('zope.org',  'Zope'),
('python.org', 'Python')"
          >
      <a tal:repeat=3D"bookmark mybookmarks"
         href=3D"dummy" span tal:attributes=3D"python: bookmark[0]"
tal:content=3D"bookmark[1]">
       Dummy link
      </a>
   </span>

To produce this:

 <a href=3D"zope.org">Zope</a>
 <a href=3D"python.org">Python</a>

But PageTemplates complain:

<!-- Page Template Diagnostics
 Compilation failed
 Products.PageTemplates.TALES.CompilerError: Invalid variable name
"bookmark[0]"
-->

How do I access the items of an Iterator in this case?

Chui