I'm not sure I understand exactly what you want to do, but I think this should do it:

In your whatever_extension.rb activate method do:

admit.page.edit.add :parts_bottom, 'your_additional_partial', :after => 'edit_layout_and_type'

Then it will look for a file in 'vendor/extensions/whatever/app/views/ admin/page/your_additional_partial' to inject into the interface.

I described the process in the help extension. If it's a new instance of Radiant (or is running on edge) just run 'script/extension install help' or if you have the Ray extension http://github.com/johnmuhl/radiant-ray-extension/tree/master run 'rake ray:help' or take a look at the Help docs directly at http://github.com/saturnflyer/radiant-help-extension/tree/master/HELP_developer.rdoc and read the 'Partial Injection' area. It applies to the way this works in the rest of the application as well. You can also read http://wiki.radiantcms.org/ Using_the_Shards_Extension (the Shards extension is now part of the core, so you can ignore the installation and configuration details)

If you want to alter the list of Layouts the Help extension provides a 'replace' method for the admin UI that you could use to completely change the default list of Layouts.

Does that answer your question?


On Sep 8, 2008, at 4:10 AM, Vincent Pérès wrote:

Hello,

My goal is to use only extensions, and don't modify radiant core.
I will try to be clear with an example. I would like to customize the
avalaible layout list when you are creating / editing a page.
But it's not possible, because the request is done directly in
views/admin/page/edit.html.haml (there is not a var which could be
change by an extension...).
How could I do that?

Here is the code :

- render_region :parts_bottom do |parts_bottom|
 - parts_bottom.edit_layout_and_type do
   .row
     %p
       %label{:for=>"page_layout_id"}
       Layout
       = select "page", "layout_id", [['<inherit>', '']] +
Layout.find(:all).map { |s| [s.name, s.id] }

I would like to give an other layout list without removing these lines?
(and I wouldn't like to hide them with javascript).

What is the best way to do that?

Thank you,
Vincent
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
Radiant mailing list
Post:   Radiant@radiantcms.org
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

_______________________________________________
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