Hi After playing and playing with Zope, I still don't understand what is the difference between DTML document and DTML method... :( Anyone can tell me clearly ? Second question... how to access a method (or document ?) located in a folder up from actual position ? I'm trying to make a sidebar menu which I could use from anywhere of my site and that should display the subfolder of a folder... Bye -- >> WinErr: 080 Clavier introuvable - Veuillez appuyer sur n'importe quelle touche pour continuer. << Arnaud LECAT >> Email: lecat@hexanet.fr >> WWW page:www.hexanet.fr/~lecat HEXANET >> http://www.hexanet.fr Z.A. Farman sud - 9 rue Roland Coffignot BP 415 - 51689 Reims Cedex 2 - France phone: (33) 03 26 79 30 05 Fax: (33) 03 26 79 30 06
On Wed, 18 Aug 1999, Arnaud Lecat wrote:
After playing and playing with Zope, I still don't understand what is the difference between DTML document and DTML method... :( Anyone can tell me clearly ?
It's explained quite clearly on the add DTML Method/Document screen.
Second question... how to access a method (or document ?) located in a folder up from actual position ? I'm trying to make a sidebar menu which I could use from anywhere of my site and that should display the subfolder of a folder...
Access it like if it was in the current folder (the magic of Acquisition). -Petru
----- Original Message ----- From: Arnaud Lecat <lecat@hexanet.fr> To: ZOPE <zope@zope.org> Sent: Wednesday, August 18, 1999 6:01 PM Subject: [Zope] I'm blind...
Hi
After playing and playing with Zope, I still don't understand what is the difference between DTML document and DTML method... :( Anyone can tell me clearly ?
DTML method is the method of the containing folder. Because of this the <!--#var title--> returns the title of the folder if you use DTML method and in the case of DTML document it returns the title of the document.
Second question... how to access a method (or document ?) located in a folder up from actual position ? I'm trying to make a sidebar menu which I could use from anywhere of my site and that should display the subfolder of a folder...
Create a new folder with an index_html document then examin the content of the document. <!--#var standard_html_header--> and <!--#var standard_html_footer--> access objects located in the root folder, so simple. Acquisition.html at zope.org explains this mechanism.
Bye -- >> WinErr: 080 Clavier introuvable - Veuillez appuyer sur n'importe quelle touche pour continuer. <<
Arnaud LECAT >> Email: lecat@hexanet.fr >> WWW page:www.hexanet.fr/~lecat
HEXANET >> http://www.hexanet.fr
Z.A. Farman sud - 9 rue Roland Coffignot BP 415 - 51689 Reims Cedex 2 - France phone: (33) 03 26 79 30 05 Fax: (33) 03 26 79 30 06
Regards, Arpad
From: Arnaud Lecat <lecat@hexanet.fr>
After playing and playing with Zope, I still don't understand what is the difference between DTML document and DTML method... :( Anyone can tell me clearly ?
There are several subtle differences in behavior, all of which boil down to one fundamental point: When rendering, a DTML Document is placed on the aquisition stack, while a DTML Method is not. Clear as mud, eh? Suppose you have a folder 'tryit' which contains Method 'm', Document 'd', and Folder 'f'. Folder 'f' contains Document 'show'. If you ask for 'tryit/f/show', then names are looked up in 'show' first, then 'f', then 'tryit'. If you ask for 'tryit/d', names are looked up in 'd' first, then in 'tryit'. If you ask for 'tryit/m', names are only looked for in 'tryit'! This is one reason Methods don't have Properties; They would be too hard to access. Consider these snippets: 1. <!--#var d--> 2. <!--#with tryit--><!--#var d---><!--#/with--> 3. <!--#with f--><!--#var d--><!--#/with--> 4. <!--#var "tryit.d(this(), REQUEST)"--> Now, acquisition always allows 'show' to access 'm' and 'd', since to get to 'show' you must pass through 'tryit' via paths like 'tryit/f/show'. If 'show' contains any of (1) through (4) then 'd' will always search itself for names first. Suppose we replace 'd' with 'm' in 1,2,3, and 4, and ask for 'tryit/f/show'. In no case will 'm' search itself for names. In (1) and (4), 'show' will be searched first. In (2), 'tryit' will be searched. In (3), 'f' will be searched.
Second question... how to access a method (or document ?) located in a folder up from actual position ? I'm trying to make a sidebar menu which I could use from anywhere of my site and that should display the subfolder of a folder...
As long as the thing you want to access is the context built by your URL, you can just name it directly. If the URL is 'a/b/c/d', then you can name any property or method of 'a', 'b', 'c', or 'd' and any object directly contained by any of them. Otherwise, just reach back to the highest object that the accessor and accessee have in common, and move forward from there. For example, to access 'a/b/s1/s2/doc' from 'a/b/c/d', you could write: <!--#with s1--><!--#with s2--><!--#var doc--><!--#/with--><!--#/with--> or just <!--#with "s1.s2"--><!--#var doc--><!--#/with--> If 'c' or 'd' might contain an 's1' you don't want, then use: <!--#with "b.s1.s2"--><!--#var doc--><!--#/with--> does-this-help-or-confuse;I-can't-tell-ly y'rs Evan Simpson
participants (4)
-
Arnaud Lecat -
Arpad Kiss -
Evan Simpson -
Petru Paler