[Zope] depthfinder

Loren Stafford lstafford@icompression.com
Mon, 22 Nov 1999 09:41:59 -0800


Don't know why it doesn't work, but you could probably work around it by
using Python's len function on PARENTS.

-- Loren

> -----Original Message-----
> From: mindlace@turtle.esosoft.net [mailto:mindlace@turtle.esosoft.net]On
> Behalf Of Ethan Fremen
> Sent: Monday, November 22, 1999 09:32
> To: zope@zope.org
> Subject: [Zope] depthfinder
>
>
> I'm trying to include code in my standard_html_footer that checks to see
> if I'm more than 2 folders deep in the site.  If so, I want a back
> button.
>
> 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:
>
>   File
> /usr/local/src/Zope-2.0.0-src/lib/python/DocumentTemplate/DT_Util.py,
> line 321, in eval
>       (Object: PARENTS[1])
>     File <string>, line 0, in ?
>     File
> /usr/local/src/Zope-2.0.0-src/lib/python/DocumentTemplate/DT_Util.py,
> line 156, in careful_getitem
>   IndexError: list index out of range
>
> (zope 2.0.0), i know about the security issue & will upgrade before
> going live.
> --
> Ethan "mindlace" Fremen
> you cannot abdicate responsibility
> for your ideology.
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
>           No cross posts or HTML encoding!
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>