# Sorting and reparenting patch

**URL:** <https://www.ruby-forum.com/t/sorting-and-reparenting-patch/72808>\
**Category:** Radiant CMS\
**Created:** [October 19, 2006, 2:01am UTC](https://www.ruby-forum.com/t/sorting-and-reparenting-patch/72808 "2006-10-19T02:01:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lorenjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5a626/32.png) [@lorenjohnson](https://www.ruby-forum.com/u/lorenjohnson)\
**Post date:** [October 19, 2006, 2:01am UTC](https://www.ruby-forum.com/t/sorting-and-reparenting-patch/72808/1 "2006-10-19T02:01:56Z")

</div>

I’m within a week of deploying a major website release for a client  
using Radiant. I’ve worked hard to not modify any of the Radiant core  
directly (made a few plugin behaviors, etc.) so that I could keep on-  
track with future updates.

However, I really could use manual page sorting and the ability to  
move pages around in the tree.

After a bit of looking around I see this patch:

[http://dev.radiantcms.org/radiant/ticket/179](http://dev.radiantcms.org/radiant/ticket/179)

Can someone give me a hint as to how I would apply this patch or  
other patches (I’m currently installed from gem with --unpack)  
without forever fouling my current radiant install?

Or if that is exactly what it would do, when is a new official  
release likely that might include this functionality?

I appreciate all the help. I’m a RoR, Radiant and SVN nuby (it’s been  
a busy few weeks).

Thanks,

Loren J.  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![lorenjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5a626/32.png) [@lorenjohnson](https://www.ruby-forum.com/u/lorenjohnson)\
**Post date:** [October 19, 2006, 3:36am UTC](https://www.ruby-forum.com/t/sorting-and-reparenting-patch/72808/2 "2006-10-19T03:36:02Z")

</div>

On 10/18/06, Loren J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> After a bit of looking around I see this patch:
> 
> I appreciate all the help. I’m a RoR, Radiant and SVN nuby (it’s been a busy  
> few weeks).

The patch is waiting for someone to clean it up to the point where it  
can be accepted. I tried my hand at it but while I can get it to  
apply cleanly to trunk, I don’t know squat about Rails internals and  
for all I know it’s an ugly hack.

I did locally apply the re-ordering portion of the patch and it’s been  
working fine, however I wouldn’t recommend this unless you want to  
deal with upgrading a patched tree or don’t plan on upgrading at all.

-Tom

---

<div class="post-metadata">

**Author:** ![lorenjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5a626/32.png) [@lorenjohnson](https://www.ruby-forum.com/u/lorenjohnson)\
**Post date:** [October 20, 2006, 10:37pm UTC](https://www.ruby-forum.com/t/sorting-and-reparenting-patch/72808/3 "2006-10-20T22:37:13Z")

</div>

Tom von Schwerdtner wrote:

> On 10/18/06, Loren J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > After a bit of looking around I see this patch:
> > 
> > I appreciate all the help. I’m a RoR, Radiant and SVN nuby (it’s been a busy  
> > few weeks).
> 
> The patch is waiting for someone to clean it up to the point where it  
> can be accepted. I tried my hand at it but while I can get it to  
> apply cleanly to trunk, I don’t know squat about Rails internals and  
> for all I know it’s an ugly hack.
> 
> I did locally apply the re-ordering portion of the patch and it’s been  
> working fine, however I wouldn’t recommend this unless you want to  
> deal with upgrading a patched tree or don’t plan on upgrading at all.
> 
> -Tom

For the record, and I don’t have time to explore why this was happening  
properly, but somehow magically (in the bad way) this patch seemed to  
break the automatic (javascript) populating of the Slug and Breadcrumbs  
from the Title on a new article. I started over from a fresh 0.5.2  
install and everything started working again.

Other than that the patch looked to be working great. Yes, the icons are  
ugly and the labels for moving and reparenting were far less than  
intuitive, but all the functionality was there.

I’d sure love to see this cleaned-up and into a release but don’t quiet  
feel qualified yet to do that work. Maybe in a month or two I’ll come  
back around to it if nobody else does.

Loren

---

<div class="post-metadata">

**Author:** ![lorenjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5a626/32.png) [@lorenjohnson](https://www.ruby-forum.com/u/lorenjohnson)\
**Post date:** [October 28, 2006, 2:56am UTC](https://www.ruby-forum.com/t/sorting-and-reparenting-patch/72808/4 "2006-10-28T02:56:50Z")

</div>

That was my work. To be honest I have not checked see if it applies to  
the current version. I doubt it does. You would also need the full src  
tree in your app as it was not based on the plug in version.

I need to get back to it as I would like to update some of my current  
sites that are using it. It is probably something that needs to be in  
the core. I have not looked at the new plug system but since it changes  
the ‘Pages’ tab some I don’t think that it would.

The changes is makes fairly minor.  
It adds a sort value  
It changes the default value to the new sort value used by the sort  
method.  
It adds a set of methods for changing the sort value  
It adds methods to reparent up and down.

John if I make a new version of this can it be considered for the Core?

---

<div class="post-metadata">

**Author:** ![lorenjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5a626/32.png) [@lorenjohnson](https://www.ruby-forum.com/u/lorenjohnson)\
**Post date:** [October 28, 2006, 5:22am UTC](https://www.ruby-forum.com/t/sorting-and-reparenting-patch/72808/5 "2006-10-28T05:22:59Z")

</div>

Erik B. Ordway wrote:

> John if I make a new version of this can it be considered for the Core?

I will definitely consider it for the core, but it should be polished  
and ready to go.

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![lorenjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5a626/32.png) [@lorenjohnson](https://www.ruby-forum.com/u/lorenjohnson)\
**Post date:** [November 7, 2006, 10:55am UTC](https://www.ruby-forum.com/t/sorting-and-reparenting-patch/72808/6 "2006-11-07T10:55:43Z")

</div>

That was a merging of bodhi sort order work and my re-parenting  
code. His sort stuff is great but the interface does not working  
IE. It is based on removing the table based layout and replacing it  
with a list + css based one. It is much nicer. I’ll try to get  
around to updating one or the other in the next week. If some one  
could come up with better icons that would be great. We hired a new  
CSS geek as of late and I might be able to get him to make the list +  
css layout working in IE.

---

<div class="post-metadata">

**Author:** ![lorenjohnson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5a626/32.png) [@lorenjohnson](https://www.ruby-forum.com/u/lorenjohnson)\
**Post date:** [November 7, 2006, 10:46am UTC](https://www.ruby-forum.com/t/sorting-and-reparenting-patch/72808/7 "2006-11-07T10:46:06Z")

</div>

I ended up using more of this code instead:  
[http://dev.radiantcms.org/radiant/ticket/199](http://dev.radiantcms.org/radiant/ticket/199)

It seems a lot cleaner now just using drag-and-drop for sorting and  
re-parenting. It isnt accesible for screen-readers, but that is usually  
not  
an issue. It works great if you have a mouse.
