How do you programmatically reorder children of an ATFolder subclass?
Asked Answered
R

1

6

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?

Rafi answered 25/10, 2008 at 23:41 Comment(0)
G
4

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.

Gotthard answered 27/10, 2008 at 16:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.