Drag & Drop Sorting of Child Pages

blog header image

Yet another small utility inspired by a customer. An editor came up to me and complained about the annoyance of setting sort-indexes manually to change the sort order or pages. Naturally I suggested the excellent EPiCode project ManageChildren - but this editor was really hooked onto the idea of doing drag and drop sorting.

Anyway, to make a long story short, a couple of quick google's and I found javascript library on Tool-man.org and thus a plugin was born.

I made a simple EditPanel GuiPlugin, implemented ICustomPlugInLoader to make sure it only appeared on pages with child-pages, and added logic to set the new sort order. Once a list is sorted and posted back, it will set the Sort Order to "SortIndex" on the parent, and then set the index values on the children, starting with 2000 and incrementing with 1000 for every child. Then they are all saved. If they were published versions, they are also published again - otherwise just saved.

Recent posts