public
Description: An extension for Radiant CMS that allows you to specify and change the order of child pages within their parent page.
Homepage:
Clone URL: git://github.com/radiant/radiant-reorder-extension.git
radiant-reorder-extension / reorder_extension.rb
100644 32 lines (26 sloc) 1.152 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Uncomment this if you reference any of your controllers in activate
require_dependency 'application_controller'
 
class ReorderExtension < Radiant::Extension
  version "0.2.0"
  description "Allows (re)ordering of pages in the page tree."
  url "http://dev.radiantcms.org/"
  
  define_routes do |map|
    map.with_options :controller => "admin/pages" do |page|
      page.page_move_lower "admin/pages/:id/move_lower", :action => "move_lower"
      page.page_move_higher "admin/pages/:id/move_higher", :action => "move_higher"
      page.page_move_to_bottom "admin/pages/:id/move_to_bottom", :action => "move_to_bottom"
      page.page_move_to_top "admin/pages/:id/move_to_top", :action => "move_to_top"
    end
  end
  
  def activate
    admin.page.index.add :sitemap_head, "order_header"
    admin.page.index.add :node, "order"
    admin.page.index.add :top, 'header'
    Page.send :include, Reorder::PageExtensions
    Admin::PagesController.send :include, Reorder::PagesControllerExtensions
    Admin::PagesController.send :helper, Reorder::PageHelper
    StandardTags.send :include, Reorder::TagExtensions
  end
  
  def deactivate
  end
  
end