[Zope] DTML question

Rik Hoekstra rik.hoekstra@inghist.nl
Wed, 28 Jun 2000 12:49:57 +0200


Luke Tymowski wrote:
> 
> Hello,
> 
> I want to retrieve the last 3 filenames from a subfolder and display them in
> a document. If I set the size of the retrieval to 1, I get just 1 name
> returned. If I set the size to 3, I get everything in the folder. (if I use
> 2 I also get everything in the subfolder )
> 
> Here is my code (using 2.2b2):
> 
> <dtml-with Document>
>   <dtml-in "objectValues(['DTML Document'])" size=3 sort=id>
>       <dtml-var id> <dtml-var title><br>
>   </dtml-in>
> </dtml-with>
> 

You could try (untested):

<dtml-with Document>
  <dtml-in "objectValues(['DTML Document'])[-3:]" sort=id>
      <dtml-var id> <dtml-var title><br>
  </dtml-in>
</dtml-with>

hth

Rik