[Zope] Displaying list of documents in sub-folders?

hans hans@beehive.de
Mon, 29 Apr 2002 12:26:17 +0100


EvH wrote:

> Hello,
>
> I'm still a newbie at Zope, so please bear with me as I read through the
> Zope Book and experiment...
>
> In the main page, I'd like to have a index_html DTML Method object display
> a list of documents that are located in sub-folders, eg. computers/, news/
>
> The following doesn't work:
>
> <dtml-in expr="objectValues('computers/DTML Document')">
>      <tr>
>      <td><a href="&dtml-absolute_url;"><dtml-var title_or_id></a></td>
>      </tr>
> </dtml-in>
>
> Should I use a Python Script object instead?

from the top of my head:
<dtml-in "objectValues('Folder')">
  <dtml-in "_['sequence-item'].objectValues('DTML Document')">

means, 1) in all folders 2) in all their Documents

http://www.zope.org/Documentation/ZopeBook/AppendixB.stx
class ObjectManager, method objectValues()

objectValues(type=None)
This method returns a sequence of contained objects.
      Like objectItems and objectIds, it accepts one argument,
      either a string or a list to restrict the results to objects
      of a given meta_type or set of meta_types.


--
-------------------------------------------------------------
Who's got only a hammer sees the world as a nail
hans augustin  (software developer)           hans@beehive.de
beehive elektronische medien GmbH       http://www.beehive.de
phone: +49 30 847-82 0                  fax: +49 30 847-82 299