Hello all, I'm learning Zope and I have a problem. I have tried the following example from "Iterating over Folder Contents", Chapter 4 of the Zope Book: <dtml-var standard_html_header> <ul> <dtml-in expr="objectValues('File')"> <li><a href="&dtml-absolute_url;"><dtml-var title_or_id></a></li> </dtml-in> </ul> <dtml-var standard_html_footer> The folder where this DTML document resides contains some files and folders, but when I run it, it doesn't show anything. It seems like objectValues is an empty list. My understanding of zope is still very limited, but I think this should work. What am I missing? I have tested with zope 2.5.1 for windows and linux (debian woody) with the same result. Any help will be apreciated. Thanks in advance -- //// (@ @) ---------------------------oOO----(_)----OOo------------------------ Los pecados de los tres mundos desapareceran conmigo. Alexis Roda - Universitat Rovira i Virgili - Reus, Tarragona (Spain) --------------------------------------------------------------------
Change the DTML Document to a DTML Method. -- Andy McKay www.agmweb.ca ----- Original Message ----- From: "Alexis Roda" <arv@si.urv.es> To: <zope@zope.org> Sent: Monday, October 07, 2002 8:44 AM Subject: [Zope] Newbie problem
Hello all, I'm learning Zope and I have a problem. I have tried the following example from "Iterating over Folder Contents", Chapter 4 of the Zope Book:
<dtml-var standard_html_header> <ul> <dtml-in expr="objectValues('File')"> <li><a href="&dtml-absolute_url;"><dtml-var title_or_id></a></li> </dtml-in> </ul> <dtml-var standard_html_footer>
The folder where this DTML document resides contains some files and folders, but when I run it, it doesn't show anything. It seems like objectValues is an empty list.
My understanding of zope is still very limited, but I think this should work. What am I missing?
I have tested with zope 2.5.1 for windows and linux (debian woody) with the same result.
Any help will be apreciated. Thanks in advance -- //// (@ @) ---------------------------oOO----(_)----OOo------------------------ Los pecados de los tres mundos desapareceran conmigo. Alexis Roda - Universitat Rovira i Virgili - Reus, Tarragona (Spain) --------------------------------------------------------------------
_______________________________________________ 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 )
Andy McKay wrote:
Change the DTML Document to a DTML Method.
Many thanks, it does work now. There's a thing I still can't understand. I have the following dtml document (not method): <dtml-var standard_html_header> <ul> <dtml-in expr="arees.objectValues('Folder')"> <li><a href="&dtml-absolute_url;"><dtml-var title_or_id></a></li> </dtml-in> <dtml-var standard_html_footer> This dtml document does work, it shows a list of folders inside the folder named "arees". I can't see the difference with <dtml-var standard_html_header> <ul> <dtml-in expr="objectValues('File')"> <li><a href="&dtml-absolute_url;"><dtml-var title_or_id></a></li> </dtml-in> <dtml-var standard_html_footer> that does not work as dtml document. Can someone enlight my ignorance? Thanks in advance -- //// (@ @) ---------------------------oOO----(_)----OOo------------------------ Los pecados de los tres mundos desapareceran conmigo. Alexis Roda - Universitat Rovira i Virgili - Reus, Tarragona (Spain) --------------------------------------------------------------------
I still consider myself a newbie too, but it seems that the code in the document is calling objectValues on an object, whereas the method is calling the objectValues method on itself. This doesn't work because a dtml method doesn't contain any 'File's, whereas the object objectValues is called on in the document is presumably a folderish object. Is this correct? -jim ----- Original Message ----- From: "Alexis Roda" <arv@si.urv.es> To: "zope" <zope@zope.org> Sent: Tuesday, October 08, 2002 10:45 AM Subject: Re: [Zope] Newbie problem
Andy McKay wrote:
Change the DTML Document to a DTML Method.
Many thanks, it does work now.
There's a thing I still can't understand. I have the following dtml document (not method):
<dtml-var standard_html_header> <ul> <dtml-in expr="arees.objectValues('Folder')"> <li><a href="&dtml-absolute_url;"><dtml-var title_or_id></a></li> </dtml-in> <dtml-var standard_html_footer>
This dtml document does work, it shows a list of folders inside the folder named "arees". I can't see the difference with
<dtml-var standard_html_header> <ul> <dtml-in expr="objectValues('File')"> <li><a href="&dtml-absolute_url;"><dtml-var title_or_id></a></li> </dtml-in> <dtml-var standard_html_footer>
that does not work as dtml document.
Can someone enlight my ignorance? Thanks in advance -- //// (@ @) ---------------------------oOO----(_)----OOo------------------------ Los pecados de los tres mundos desapareceran conmigo. Alexis Roda - Universitat Rovira i Virgili - Reus, Tarragona (Spain) --------------------------------------------------------------------
_______________________________________________ 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 )
On Tue, Oct 08, 2002 at 01:48:51PM -0400, ebizQ Zope wrote:
This doesn't work because a dtml method doesn't contain any 'File's, whereas the object objectValues is called on in the document is presumably a folderish object.
Is this correct?
Nope. A dtml method is a method *of* a folderish object. When a dtml method calls objectValues(self), the "self" is really the calling context (the folder). If you said DTML *Document*, I think you'd be correct. It should try to find objects within itself. But I haven't tried this in a long time - I forget what results. --PW -- Paul Winkler "Welcome to Muppet Labs, where the future is made - today!"
participants (4)
-
Alexis Roda -
Andy McKay -
ebizQ Zope -
Paul Winkler