It works just like the 'add' method. I have this in the Help extension:
Radiant::AdminUI::RegionSet.class_eval do
      def replace(region=nil, partial=nil)
raise ArgumentError, "You must specify a region and a partial" unless region and partial
        self[region].replace([partial])
      end
    end
So you can just do

admin.page.edit.replace :the_part, 'my_part'

The only documentation is where I implemented it
http://github.com/saturnflyer/radiant-help-extension/tree/6b691a675955bdf934ebba7f3ec6bf3142094b90/help_extension.rb

Although, now that I look at it, I realize that this is pointless because you can just create a partial of the same name and Radiant will pick it up. So just create a partial in your extension in 'app/views/admin/page/ edit_layout_and_type' and It will be picked up instead of the default.

Sorry for the long-winded response.

On Sep 8, 2008, at 7:46 AM, Vincent Pérès wrote:

Hello Jim,

I had already use shards to inject and extend functionnalities to pages,
it's not a problem.
Here, I would like to remove or replace an 'existing' part : layout
list, to replace it by my list for example.

I didn't see we can 'replace' a part, thank you.
Do you have any documentation about the replace method?
What does it looks like?

Thank you !
Vincent
_______________________________________________
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to