[Zope] Overriding root URL for tree links, how?

Alexander Staubo alex@mop.no
Sat, 6 Nov 1999 12:24:46 +0100


Whenever somebody clicks on the "plus" or "minus" icons of a tree, I
need to pass the request's query as well.

Unfortunately, it seems that, while you can override the root URL,
Zope's tree tag always prepends the "?" before its tree variables, thus:

	<dtml-with "_.namespace(URL = 'Edit?Id:int=' + 
        _.str(REQUEST.ItemId) + '&'">
        <dtml-tree ...>
          ...
        </dtml-tree>
      </dtml-with>

For the icons, the tree tag constructs HTML such as

<A NAME="151167"><A
HREF="Edit?ItemId:int=1&?tree-c=eJyLVneEgWxPW3UdBUNTQ0Mz81gASooFwg#15116
7"><IMG SRC="/p_/mi" BORDER=0></A></A>

So I've hacked TreeTag.py quick and dirty-like to check for a
terminating "&" in the root URL. If present, it will pass the root URL
as is; if not present, it will append the "?" delimiter. This is ugly,
but works.

Btw, it seems that <dtml-tree url="..."> doesn't have any influence. Why
not?

I've also found the need to refer to the "tree-c" or "tree-e" variables
used by the tree tag, but these seem to be unavailable through DTML.

-- 
Alexander Staubo             http://www.mop.no/~alex/
"`Ford, you're turning into a penguin. Stop it.'"
--Douglas Adams, _The Hitchhiker's Guide to the Galaxy_