I have two questions where I just couldn't find the answer to (the documentation-retrieval is killing me): 1. How can a dtml-method know which folder it is in? 2. How can an external method know which folder it is in? I think I read this somewhere - I just can't retrieve it... Ragnar
Try looking at the PARENTS list: I'd say that you want something like <dtml-var "PARENTS[-1]"> which should give you this objects parent. Caveat: I'm not sure if this works with DTML Methods. Phil phil.harris@zope.co.uk | -----Original Message----- | From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of | Ragnar Beer | Sent: Tuesday, February 08, 2000 12:49 PM | To: zope@zope.org | Subject: [Zope] Parents | | | I have two questions where I just couldn't find the answer to (the | documentation-retrieval is killing me): | | 1. How can a dtml-method know which folder it is in? | | 2. How can an external method know which folder it is in? | | I think I read this somewhere - I just can't retrieve it... | | Ragnar | | _______________________________________________ | Zope maillist - Zope@zope.org | http://lists.zope.org/mailman/listinfo/zope | ** No cross posts or HTML encoding! ** | (Related lists - | http://lists.zope.org/mailman/listinfo/zope-announce | http://lists.zope.org/mailman/listinfo/zope-dev ) |
That's what I thought how it SHOULD work, but <dtml-var "PARENTS[-1]"> returns nothing and <dtml-var "PARENTS"> returns "[, , ]" the url beeing http://mydomain.de/test/parents_test/index_html no matter whether I access index_html via "view" or url traversal.
Try looking at the PARENTS list:
I'd say that you want something like <dtml-var "PARENTS[-1]"> which should give you this objects parent.
Caveat: I'm not sure if this works with DTML Methods.
Phil phil.harris@zope.co.uk
| -----Original Message----- | From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of | Ragnar Beer | Sent: Tuesday, February 08, 2000 12:49 PM | To: zope@zope.org | Subject: [Zope] Parents | | | I have two questions where I just couldn't find the answer to (the | documentation-retrieval is killing me): | | 1. How can a dtml-method know which folder it is in? | | 2. How can an external method know which folder it is in? | | I think I read this somewhere - I just can't retrieve it... | | Ragnar | | _______________________________________________ | Zope maillist - Zope@zope.org | http://lists.zope.org/mailman/listinfo/zope | ** No cross posts or HTML encoding! ** | (Related lists - | http://lists.zope.org/mailman/listinfo/zope-announce | http://lists.zope.org/mailman/listinfo/zope-dev ) |
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Try something like <dtml-var "PARENTS[-1].title_or_id"> Maybe??? Phil | -----Original Message----- | From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of | Ragnar Beer | Sent: Tuesday, February 08, 2000 4:15 PM | To: zope@zope.org | Subject: [Zope] Parents again | | | That's what I thought how it SHOULD work, but <dtml-var | "PARENTS[-1]"> returns nothing and <dtml-var "PARENTS"> returns "[, , | ]" the url beeing http://mydomain.de/test/parents_test/index_html no | matter whether I access index_html via "view" or url traversal. | | | >Try looking at the PARENTS list: | > | >I'd say that you want something like <dtml-var "PARENTS[-1]"> | which should | >give you this objects parent. | > | >Caveat: I'm not sure if this works with DTML Methods. | > | >Phil | >phil.harris@zope.co.uk | > | >| -----Original Message----- | >| From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of | >| Ragnar Beer | >| Sent: Tuesday, February 08, 2000 12:49 PM | >| To: zope@zope.org | >| Subject: [Zope] Parents | >| | >| | >| I have two questions where I just couldn't find the answer to (the | >| documentation-retrieval is killing me): | >| | >| 1. How can a dtml-method know which folder it is in? | >| | >| 2. How can an external method know which folder it is in? | >| | >| I think I read this somewhere - I just can't retrieve it... | >| | >| Ragnar | >| | >| _______________________________________________ | >| Zope maillist - Zope@zope.org | >| http://lists.zope.org/mailman/listinfo/zope | >| ** No cross posts or HTML encoding! ** | >| (Related lists - | >| http://lists.zope.org/mailman/listinfo/zope-announce | >| http://lists.zope.org/mailman/listinfo/zope-dev ) | >| | > | > | >_______________________________________________ | >Zope maillist - Zope@zope.org | >http://lists.zope.org/mailman/listinfo/zope | >** No cross posts or HTML encoding! ** | >(Related lists - | > http://lists.zope.org/mailman/listinfo/zope-announce | > http://lists.zope.org/mailman/listinfo/zope-dev ) | | | _______________________________________________ | Zope maillist - Zope@zope.org | http://lists.zope.org/mailman/listinfo/zope | ** No cross posts or HTML encoding! ** | (Related lists - | http://lists.zope.org/mailman/listinfo/zope-announce | http://lists.zope.org/mailman/listinfo/zope-dev ) |
This is only confusing until you realise that PARENTS[whatever] returns an object ;-) <dtml-var "PARENTS[-1].title"> or <dtml-var "PARENTS[-1].id"> might make more sense... Chris Ragnar Beer wrote:
That's what I thought how it SHOULD work, but <dtml-var "PARENTS[-1]"> returns nothing and <dtml-var "PARENTS"> returns "[, , ]" the url beeing http://mydomain.de/test/parents_test/index_html no matter whether I access index_html via "view" or url traversal.
Try looking at the PARENTS list:
I'd say that you want something like <dtml-var "PARENTS[-1]"> which should give you this objects parent.
Caveat: I'm not sure if this works with DTML Methods.
Phil phil.harris@zope.co.uk
| -----Original Message----- | From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of | Ragnar Beer | Sent: Tuesday, February 08, 2000 12:49 PM | To: zope@zope.org | Subject: [Zope] Parents | | | I have two questions where I just couldn't find the answer to (the | documentation-retrieval is killing me): | | 1. How can a dtml-method know which folder it is in? | | 2. How can an external method know which folder it is in? | | I think I read this somewhere - I just can't retrieve it... | | Ragnar | | _______________________________________________ | Zope maillist - Zope@zope.org | http://lists.zope.org/mailman/listinfo/zope | ** No cross posts or HTML encoding! ** | (Related lists - | http://lists.zope.org/mailman/listinfo/zope-announce | http://lists.zope.org/mailman/listinfo/zope-dev ) |
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Chris Withers wrote:
This is only confusing until you realise that PARENTS[whatever] returns an object ;-)
<dtml-var "PARENTS[-1].title"> or <dtml-var "PARENTS[-1].id">
might make more sense...
Chris
Ragnar Beer wrote:
That's what I thought how it SHOULD work, but <dtml-var "PARENTS[-1]"> returns nothing and <dtml-var "PARENTS"> returns "[, , ]" the url beeing http://mydomain.de/test/parents_test/index_html no matter whether I access index_html via "view" or url traversal.
Try looking at the PARENTS list:
I'd say that you want something like <dtml-var "PARENTS[-1]"> which should give you this objects parent.
Caveat: I'm not sure if this works with DTML Methods.
Additional Caveat: PARENTS[-1] gets you the _root_ folder, which isn't always the parent. In "http://mydomain.de/test/parents_test/index_html", PARENTS[-1].id gets you whitespace (the id of the root folder), not parents_test. For that, you want <dtml-var "PARENTS[0].id"> -- In flying I have learned that carelessness and overconfidence are usually far more dangerous than deliberately accepted risks. -- Wilbur Wright in a letter to his father, September 1900
Hooray, thanks a lot for your answers! Works great! Meanwhile I really got frustrated, downloaded all the zope documentation I could get from the net, packed it all into one BIG (6Megs, 1300 pages) PDF file, searched it and found the solution in the DTML Namespace Howto. Just as I thought: it was a retrieval problem. I wish I could get all the List archives (with threads) into one file, too. There's such a lot of Information out there... Ok, here are the answers that I found:
| 1. How can a dtml-method know which folder it is in?
<dtml-var "PARENTS[0].id">
| 2. How can an external method know which folder it is in?
self.REQUEST.PARENTS[0].id Ragnar
Just as I thought: it was a retrieval problem. I wish I could get all the List archives (with threads) into one file, too. There's such a lot of Information out there...
You can. Download all the [Archives] from http://www.zope.org/Resources/MailingLists I try to keep a local copy of all the mailing list posts on my hard disk. When I have a problem with syntax, generally, I just grep the local copy for what I'm looking for. -- Chris McDonough - Digital Creations, Inc. Publishers of Zope - http://www.zope.org
That's exactly what I do but I found out that searching a huge textfile without threads is a pain in the butt. I have one file with all the archives and search it with emacs. Perhaps there's a way to do this better? A couple of days ago Sam Gendler wrote: "I have been saving copies of all responses to questions like this, that are asked SO frequently by newbies. I have about 40 questoins answered now." Wouldn't it be nice if some people would just like him collect postings topic-specifically and without even putting them together to a howto just put them somewhere where they could be accessed easily under a catchword? Ragnar
Just as I thought: it was a retrieval problem. I wish I could get all the List archives (with threads) into one file, too. There's such a lot of Information out there...
You can. Download all the [Archives] from http://www.zope.org/Resources/MailingLists
I try to keep a local copy of all the mailing list posts on my hard disk. When I have a problem with syntax, generally, I just grep the local copy for what I'm looking for.
-- Chris McDonough - Digital Creations, Inc. Publishers of Zope - http://www.zope.org
A couple of days ago Sam Gendler wrote: "I have been saving copies of all responses to questions like this, that are asked SO frequently by newbies. I have about 40 questoins answered now."
Wouldn't it be nice if some people would just like him collect postings topic-specifically and without even putting them together to a howto just put them somewhere where they could be accessed easily under a catchword?
For instance on the ZDP site (http://zdp.zope.org:8080). The ZDP can always use contributions like this... Rik
Hi Ragnar et all, At ZDP, we're (mostly Maik with his ZDP-Tools) working on such a feature, called ZFAQ. This is almost finished!! It will also be fully searchable with the help of ZCatalog!!! I think at the end of the week, we can show something! And then, I hope people will visit ZDP. And I hope all people who collect such FAQ's are willing to put them into ZFAQ.... Regards, Tom
That's exactly what I do but I found out that searching a huge textfile without threads is a pain in the butt. I have one file with all the archives and search it with emacs. Perhaps there's a way to do this better?
A couple of days ago Sam Gendler wrote: "I have been saving copies of all responses to questions like this, that are asked SO frequently by newbies. I have about 40 questoins answered now."
Wouldn't it be nice if some people would just like him collect postings topic-specifically and without even putting them together to a howto just put them somewhere where they could be accessed easily under a catchword?
Ragnar
Just as I thought: it was a retrieval problem. I wish I could get all the List archives (with threads) into one file, too. There's such a lot of Information out there...
You can. Download all the [Archives] from http://www.zope.org/Resources/MailingLists
I try to keep a local copy of all the mailing list posts on my hard disk. When I have a problem with syntax, generally, I just grep the local copy for what I'm looking for.
-- Chris McDonough - Digital Creations, Inc. Publishers of Zope - http://www.zope.org
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (7)
-
Bill Anderson -
Chris McDonough -
Chris Withers -
Phil Harris -
Ragnar Beer -
Rik Hoekstra -
Tom Deprez