How to add new content on top of a folder
By default Plone adds new content to the bottom of a folder. With zope3 event-handlers you can change that behaviour easily.
Here we use event handlers to push newly-created NewsItems to the top of the page. Usefull for blog-style folders. It doesn't apply when editing existing content.
Add a new subscriber to your configure.zcml (you might want to use your site-policy- or theme-product):
<subscriber for="Products.ATContentTypes.interface.news.IATNewsItem zope.app.container.interfaces.IObjectAddedEvent" handler=".newsitemmover.moveToTop" />
Create the new file newsitemmover.py containing
def moveToTop(obj, event): """ Moves Items to the top of its folder """ folder = obj.getParentNode() if folder != None: folder.moveObjectsToTop(obj.id)
Restart Zope.
The tricky part is to choose the correct Interfaces for the subscriber. Keep in mind that IObjectAddedEvent is called several times during adding a NewsItem. It doen't matter in this case since the item can't be any more on top than on top :-)