Netsight Blog

Cool stuff Netsight are up to in Zope and Plone

Avatar

Moving an object to the top of a folder listing

written by Matthew Sital-Singh, on Oct 7, 2009 3:03:00 PM.

As whizzy as Plone 3's AJAX drag-and-drop folder re-ordering is, it's fairly unusable when you have a large number of items and need to move an item from the very bottom to the very top (or vice versa).

Doing a little AJAX debugging reveals that the heavy loading of this drag-drop functionality is actually done by a simple skin script, folder_position.py, which you can actually pass all manner of arguments into.

Moving an item to the top of a folder as as easy as calling the aforementioned script on a folder, passing 'position' as 'top' and 'id' as the id of the object you want to move e.g.

http://mysite/myfolder/folder_position?position=top&id=banana

You could also pass in 'position=bottom' to move it to the bottom.

Comments

  • Nice. My content managers would love this. Need to added a Top & Bottom tool to the folder_content view.

    Comment by Lee Joramo — Oct 7, 2009 3:52:39 PM | # - re

  • Hi,

    thanks for this tip. I added it as a recipe to our bibliography on zotero:

    www.zotero.org/groups/3197

    www.zotero.org/groups/plone/items/65449896

    Comment by Jan Ulrich Hasecke — Oct 7, 2009 6:44:08 PM | # - re

  • Someone really should fix the javascript for drag-and-drop. Currently it fires off a request for each position moved so dragging an item 10 places fires 10 ajax requests. This never works in practice, reload the page and everything is mixed up. Only one ajax request should be fired onmouseup.

    Comment by Laurence Rowe — Oct 8, 2009 1:45:32 PM | # - re

Leave a Reply