July 14th, 2004, 10:52 AM
zope (ZPT): here/objectValues returns nothing?
I am trying to get a list of files inside a folder using ZPT. Using "here/title", I am able to get the title of the current folder just fine.
However, when I use a repeat statement to iterate over "here/objectValues", it returns nothing, objectValues is empty. I have multiple files in that folder.
Any thoughts as to why it is returning an empty list?
If not, could anyone give some insight on how to print out a objects attributes or dump the object to the screen in ZPT?
Note: it does not return an empty list when logged in, only when viewing from the web as anonymous.
Thanks in advance for any help!
July 14th, 2004, 10:53 PM
Havn't done anything with Zope in a long while but it sounds like the folder you're trying to access is not accessable to the public i.e. is a protected by Zope.
What folder are you trying to map? Also, is this a folder containing Zope objects/pages in the ZODB or some other folder?
Hope this helps,
July 15th, 2004, 12:02 AM
Putting this into a page template works for me:
<p>here/objectvalues: <i tal:content="here/objectValues">object values go here</i>.</p>
When I view that ZPT. Are you using tal:content?
July 15th, 2004, 08:31 AM
How to get Parent Object
I appreciate your help.
It actually ends up that "here" was referencing a document instead of the folder that I was in. Natrually, that document did not contain any children objects.
So now the trouble is, how do I access the parent folder of a document (in order to retrieve all siblings of the document).
I would like to know how to do this in ZPT. Any help on this would be much appreciated!
July 15th, 2004, 09:42 AM
You want the container of that object. Something like this should work:
Originally Posted by lanasa
<span tal:content="container/objectValues" />