[Zope] Ordered Folders
Janko Hauser
jhauser@ifm.uni-kiel.de
Sun, 10 Oct 1999 21:37:11 +0200 (CEST)
Itamar Shtull-Trauring writes:
> Janko Hauser wrote:
> > > The first thing I need to create is a ZClass, inheriting from Folder, where
> > > the order of the objects it contains is persistent, and can be changed by
> > > the users. That is, I want the user to be able to move the fifth object to
> > > be third in the list.
> >
> > The ZClass/Folder can have a simple lines property, which serves as a
> > sheet where the order of objects can be edited.
>
> But a regular Folder doesn't display the objects in it based on this
> property. So how do I make it display them according to this property, and
> make sure that when I use the <dtml-in> tag it will also return the objects
> in this order (the whole point of the excercise)?
>
So, where do you want to 'view' this ordered list? In the managment
interface? Or in a DTML method? The first one is more difficult as the
management interface does not use a protokoll.
But if you want to iterate in a DTML method with <dtml-in> than you
can ask the content_order property of that folder to return the id in
the given order.
You are in test, which has this property.
<dtml-in content-order>
<dtml-with sequence-item>
<dtml-var id><BR>
</dtml-with>
</dtml-in>
If your ordering can be expressed programmatically you can filter the
output of objectValues() and return a list with a simple external
method.
HTH
__Janko