[Zope] Accessing Folder Objects - Newbie Question

James W. Howe jwh@allencreek.com
Fri, 14 Jan 2000 17:34:38 -0500


Unfortunately I don't know what the name of the folder will be at the time 
the method is evaluated.  In other words I need to be prepared to handle 
URLs of the form:

http://foobar.com/Root/FolderX/NewsPage

where FolderX could be any object which contains news articles.  So far my 
current workaround is to do the following

<dtml-in "PARENTS[1].objectValues('NewsArticle')">

which works, but is uglier than I like for a variety of reasons.



At 05:17 PM 1/14/00 -0500, you wrote:
>On Fri, 14 Jan 2000, James W. Howe wrote:
>
> > 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).
> >
> > My question is this, what would the code have to look like in
> > allNewsArticles to make this work?
>
>What about (untested):
>
>   <dtml-return "FolderA.objectValues(['News Article'])">
>
>assuming you don't mind explicitly referencing FolderA.
>
>--Jeff
>
>---
>Jeff K. Hoffman                                         704.849.0731 x108
>Chief Technology Officer                                mailto:jeff@goingv.com
>Going Virtual, L.L.C.                                   http://www.goingv.com/


James W. Howe				mailto:jwh@allencreek.com
Allen Creek Software, Inc.		pgpkey: http://ic.net/~jwh/pgpkey.html		
Ann Arbor, MI  48103