[Zope] Doubt about the ZPT example in Using Zope Page Templates
Josef Meile
jmeile@hotmail.com
Fri, 27 Jun 2003 12:11:56 +0200
Hi,
I'm sory about posting this comment here, but although I log into zope.org,
I can't
add a comment here:
http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx/commentForm?level:int=2&index:int=47
The thing is that I was trying to figure out how one could add a default
title when a
document doesn't have one. If you run the previous example (see the link
above),
you'll see an ugly cell without borders when a title wasn't provided. So, I
discovered
that it could solved replacing the line where the titles are written by this
one:
<td tal:content="python:item.title or default">No Title</td>
I still don't understand why this sintax doesn't work:
<td tal:content="python:item/title or default">No Title</td>
It returns:
Error Type: NameError
Error Value: global name 'title' is not defined
but in fact, title is an attribute of item.
Any comments?
Thanks in advanced,
Josef