I imagine this would be an excellent opportunity to learn the <dtml-try> ... <dtml-except> ... </dtml-try> tags. They make truly wonderful ways around errors you don't expect, and in this case, some that you do. But would this be considered cheating? -- Jim Washington Oleg Broytmann wrote:
On Mon, 22 Nov 1999, Ethan Fremen wrote:
why doesn't this work? It fails if PARENTS[1] evaluates to false.
<dtml-if "PARENTS[1]"><a href="<dtml-var "PARENTS[1].absolute_url()">">back</a></dtml-if>
last lines of traceback:
IndexError: list index out of range
The error message said it all - list index out of range. Read: there is no PARENTS[1], only PARENTS[0]. Test "_.len(PARENTS) > 1"...
Oleg. ---- Oleg Broytmann Foundation for Effective Policies phd@phd.russ.ru Programmers don't die, they just GOSUB without RETURN.