Forum: Radiant CMS ANN: Reordering of Pages

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A5877d701b5d6af7f990ced46067ca85?d=identicon&s=25 Adam Williams (Guest)
on 2007-02-08 06:23
(Received via mailing list)
Radiant Users,

I have just checked in the reorder extension [1]. It adds the ability
to reorder the children of a Page. This continues to address ticket
45 [2]. John Long has written 99% of the reordering code; I simply
made a couple of tests pass and made his work, as seen in this [3]
patch, an extension. There have been a few tags added to aid
navigation of Pages as well - more will come soon. The plan is to
eventually make this  feature a part of core, but the extension can
help some of you today.

Please do view the README. Being mindful of interfaces, I hope that
the update:public task that you encounter can become better named in
the future.

Hoping you find this useful,

  adam williams (aiwilliams)



[1] http://dev.radiantcms.org/svn/radiant/branches/men...
reorder
[2] http://dev.radiantcms.org/radiant/ticket/45
[3] http://dev.radiantcms.org/radiant/attachment/ticket/45/
sortable_pages.mental.3.diff
D9d097cf3cd38b676447899eb698930f?d=identicon&s=25 Loren Johnson (Guest)
on 2007-02-08 07:54
(Received via mailing list)
Hoorah! hoorah!

Thank you, thank you and thank you! to John and Adam.

This is going to make several things better for our particular use of
Radiant.

Loren
329bfa71096934d3a0c530f59577eb22?d=identicon&s=25 Todd McGrath (Guest)
on 2007-02-08 14:03
(Received via mailing list)
Nice job John and Adam!

In my case, I think it's going to make more sense for users to have
position be
the default order.  So, I made the following change in standard_tags.rb
to set
default order by to use position in children:each:

#by = (attr[:by] || 'published_at').strip
by = (attr[:by] || 'position').strip

I'll hope this change is incorporated into core in the future :)

Todd


Quoting Adam Williams <adam@thewilliams.ws>:
A5877d701b5d6af7f990ced46067ca85?d=identicon&s=25 Adam Williams (Guest)
on 2007-02-08 16:36
(Received via mailing list)
On Feb 8, 2007, at 8:02 AM, Todd McGrath wrote:

> In my case, I think it's going to make more sense for users to have
> position be
> the default order.  So, I made the following change in
> standard_tags.rb to set
> default order by to use position in children:each:
>
> #by = (attr[:by] || 'published_at').strip
> by = (attr[:by] || 'position').strip
>
> I'll hope this change is incorporated into core in the future :)

Todd,

In the extension, and extensibly in the patch that may be used in the
future, the children association has been modified to be:

    Page.reflections[:children].options[:order] = "position ASC"

I can see why you would want this in children_find_options as well.
Once a collection becomes an array, the position is the natural sort
order. On the other hand, part of the default behavior of
children_find_options is to only return children which are published.
This could be used to argue that published_at is a more appropriate
sort order.

It would be nice to hear from others on this matter. Please indicate
why one way is better than another.

   adam williams
This topic is locked and can not be replied to.