[Zope] dynamic navigation menu: comparing context to container

Mark McEahern marklists@mceahern.com
Thu, 1 Aug 2002 15:57:29 -0500


[I wrote]
> Here's what the script looks like:
>
> # Return boolean indicating whether the specified item should be
> # displayed as selected.
>
> current = context
>
> while 1:
>   if current == container:
>     break
>   if item == current:
>     return 1
>   current = current.getParentNode()
>
> return 0

[snip]

I think the reason current (i.e., context) is equal to container is the fact
that the script is stored in the container.

So with this kind of structure:

  /Root/
    navtest/
      select_this
      content/
        a/

even though I navigate explicitly to a, since the ZPT macros are in navtest
and so is select_this, the context is navtest.

Hmm, how do I get the intended context?

// mark