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? Samir
Samir Mishra wrote:
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?
My guess: You have created a DTML Document, but it should be a DTML Method!!! A DTML Document has its own namespace etc, a DTML Method uses the current one. So: Create the code in a DTML Method and should work... -mj
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
participants (3)
-
Dieter Maurer -
Maik Jablonski -
Samir Mishra