Manual page sorting in admin view

This in part comes from my desire (like others) to generate tree-style
navigation for a website, and (personally) to improve generated
sitemaps. This might introduces more complication than the end-result
warrants, but I’ll toss it out there anyway.

What I’m thinking about (and unskillfully hacking at) is the ability
to manually sort the admin view via DnD and to have <r:children> use
this ordering. After some poking around, it looks like it would
require these changes:

  1. A new ‘position’ column in the pages table.
  2. upon creation, a page would be given a position of
    parent.children.count - any virtual pages. This would put new pages
    at the botom of the list (instead of placing them by title).
  3. upon page deletion, any siblings with greater position would need
    that value decremented
  4. a reposition method
  5. tweaks to the page index view to allow the re-ordering, and some
    kinda no-JS fallback up/down arrows.

There is quite likely more code it would touch… so I ask: does
anyone want this and would it be worth it?


I think anyone would like that (me for sure). There was some talk of dnd
ordering in the list some time ago, check the archives, and it was
positive talking :slight_smile:

2006/9/24, Tom von Schwerdtner [email protected]:

On 24/09/06, Tom von Schwerdtner [email protected] wrote:

generate tree-style navigation for a website

improve generated sitemaps

sort the admin view via DnD and <r:children> use this ordering.

Those 3 features sound awesome and very useful IMO. The Drag-n-Drop
feature would be an interface nicety even if it didn’t do anything
practical! :slight_smile:

Would you be using scripalicious for this or another JS library?


On 9/24/06, Dave C. [email protected] wrote:

Would you be using scripalicious for this or another JS library?

scriptalicious, but I’m new to Rails so maybe I just don’t know any
better :slight_smile:


There is a patch for this, actually two I believe, but it is a little
rough around the edges. For one thing, it breaks the CSS for the
Snippets and Layouts pages, though this is easily fixed. I have used
this patch on pretty much every site lately, as it makes them much
nicer to use.

Here is a link:

If in anyone is interested in cleaning the patch up and trying to get
it into the core, I would be willing to help. I have most of the CSS
problems solved, but have not looked at the second reparenting patch.
The biggest problem is switching John’s very nice table over to an
unordered list, but this is accomplished in the patch. The entire
page index page needs to be changed, but this work is mostly done.

Keith B.