DTML Tree (was RE: [Zope] Me vs. The Zope Book Pt. 1)

Samir Mishra SamirMishra@cbuae.gov.ae
Tue, 4 Feb 2003 08:37:29 +0400


Thanks. Defining the code in a DTML method works. 

Now, for the second part - how do I go about generating the tree with the
branches and leaves as links? I'm sure this has been done before...

Samir.


-----Original Message-----
From: Dieter Maurer [mailto:dieter@handshake.de]
Sent: Monday, February 03, 2003 23:25
To: Samir Mishra
Cc: 'zope@zope.org'
Subject: Re: [Zope] Me vs. The Zope Book Pt. 1


Samir Mishra wrote at 2003-2-3 18:34 +0400:
 > I can't get some of the things mentioned in the ZB to work as expected.
If
 > anyone could tell me what I'm doing wrong, that'll be much appreciated.
 > 
 > 1. The following code -
 >     <dtml-tree>
 >       <dtml-var getId>
 >     </dtml-tree>
 > gives me nothing! Even in root, when I'm logged in as site manager,  &
when
 > I'm an authenticated user, when the script has a proxy role of Manager,
when
 > it doesn't, etc. According to ZB (pg. 124) I should see a display of an
HTML
 > tree. What am I missing?
Almost surely, this code is in a DTML Document (rather than DTML Method).

  For some unknown (stupid) reason the base class of most
  Zope object classes ("OFS.SimpleItem.SimpleItem") defines
  Object Manager methods (such as those used by "dtml-tree").
  Of course, these methods cannot return useful results.

  DTML Document looks first in its local namespace (and finds
  the bad Object Manager methods); only then it looks in
  the namespace defined by its context.

  DTML Method looks only in the namespace defined by its context.

As a general rule: do not use DTML Document -- unless you know
precisely what you are doing.


Dieter