[Zope] Accessing Folder Objects - Newbie Question

Kevin Dangoor kid@kendermedia.com
Fri, 14 Jan 2000 17:53:40 -0500


----- Original Message -----
From: "James W. Howe" <jwh@allencreek.com>
To: <zope@zope.org>
Sent: Friday, January 14, 2000 5:00 PM
Subject: [Zope] Accessing Folder Objects - Newbie Question


> I would like to do something similar to the following in the NewsPage
> index.html method:
>
> <dtml-in allNewsArticles>
> <dtml-var Title>
> <dtml-var Teaser>
> </dtml-in>
>
> To make this work I would use a URL similar to this:
>
> http://foobar.com/Root/FolderA/NewsPage
>
> FolderA would implement the allNewsArticles method which would answer the
> collection of all contents in FolderA which are a "news article" (probably
> based on the meta-type of the object).

You can use objectValues() or objectIds().

A typical usage is:

<dtml-in "objectValues(['NewsItem'])">
<do things with the news items>
</dtml-in>

objectValues returns a list containing the objects themselves. objectIds
returns a list containing the ID strings.

Kevin