Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you programmatically reorder children of an ATFolder subclass?

I have Plone product that uses a custom folder type for containing a set of custom content objects. The folder type was created by subclassing BaseFolder and it has a schema with a couple of text fields. Currently, when custom objects are added to the custom folder, the objects are sorted alphabetically by their id. How can I override this behavior and allow my users to sort the custom folders manually, say through the "Contents" view?

like image 393
Cody Brimhall Avatar asked Oct 25 '08 23:10

Cody Brimhall


1 Answers

Quickest solution: subclass from ATFolder instead of BaseFolder. That gives you all the "normal" reordering and other commmon plone folder capabilities (which I suspect you also want).

If you want to be more selective, look into Products/ATContentTypes/content/base.py: ATCTOrderedFolder and OrderedBaseFolder.

like image 174
Reinout van Rees Avatar answered Sep 21 '22 20:09

Reinout van Rees