[ZDP] faq additions

Rik Hoekstra hoekstra@fsw.LeidenUniv.nl
Tue, 15 Jun 1999 10:14:28 +0200

I have some additions to the FAQ; which I believe are not covered (but then,
I may be wrong). These are not complicated matters, but I noticed that they
are still rather frequently asked on the Zope list.

I still add them through the ZDP, not automatically. Should I add them
automatically (I think this is the better way, because everyone can review
the items added, but it is a bit more work for the editor)

Rik Hoekstra

* How do I sort the DTML_methods of a folder in DTML?

      There is a difference between DTML Documents and DTML methods here, as
      methods are 'attributes' of a Folder and DTML Documents are separate
      objects on. Thus from DTML Documents the code is:

	<!--#with "PARENTS[0]"-->
        <!--#in expr="objectValues(['DTML Document'])" sort=title
          <p><a href="<!--#var id-->"><!--#var title--></a></p>

      and from DTML Methods it is:

      <!--#in expr="objectValues(['DTML Document'])"-->
         <p><a href="<!--#var id-->"><!--#var title--></a></p>

      a) these methods both return DTML Documents *only*. If you want to
      return both DTML Documents *and* DTML Methods, use

      <!--#in expr="objectValues(['DTML Document', 'DTML Method'])"-->

      b) if you stick this code in a separate document and then call it from
      another document, the difference between DTML Method and DTML Document
      mentioned above is important from the point of view of the *calling*
      document, and not from the code document.

* How do I reverse the sorted DTML_methods of a folder in DTML?
      As from Zope 1.10.3 this is a standard feature of both the in tag and
      tree tag. Use it like

      <!--#in expr="objectValues(['DTML Document'])" sort='title' reverse-->

* How do I sort documents by the time they were last modified?

      <!--#in objectValues sort=bobobase_modification_time-->

      N.B. You can also use a reverse here!