Home

Awesome

Reorder Children

About

Adds the ability to reorder the children of a certain page with drag and drop. Tested on Radiant 1.0.0.rc2, but should work for older versions.

This extension is based on the work done by John Long in preparation for the feature to be a part of Radiant 0.6.1. In the interest of making it available as soon as possible, it has been packaged here for all the world to see.

"packaged here" was actually pointing to the old radiant subversion repository, so it was regenerated in a modern Radiant, and cleaned up a bit.

Installation

git clone git://github.com/jomz/radiant-reorder_children-extension.git vendor/extensions/reorder_children

or, add the gem to your environment.rb:

config.gem "radiant-reorder_children-extension"

Then update and migrate:

rake db:migrate:extensions
rake radiant:extensions:reorder_children:update

Remember that when working with Bundler, you will want to do something like (sample below assumes that you are using Radiant in production - change "production" to "development" or something else if you are using a different environment):

bundle exec rake db:migrate:extensions RAILS_ENV=production
bundle exec rake radiant:extensions:reorder_children:update RAILS_ENV=production

###Added Tags

Adds r:next and r:previous tags. These default to the previous and next sibling by position. Add a 'by' attribute to use i.e. the published_at column.

<r:next [by="position|published_at|slug"]></r:next>