Moving an object to the top of a folder listing

by Matt Sital-Singh on Oct 07, 2009
Filed Under:

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.

Filed under: , ,
Lee Joramo
Lee Joramo says:
Oct 07, 2009 04:52 PM

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

Jan Ulrich Hasecke
Jan Ulrich Hasecke says:
Oct 07, 2009 07:44 PM

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

Laurence Rowe
Laurence Rowe says:
Oct 08, 2009 02:45 PM

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.

Commenting has now closed on this post.

Follow us

— via Twitter

Is proudly sponsoring #BlueLightCamp today. If you want to come talk Open Source content management @HammerToe is there #blcamp
last month