One of the "most requested" features for Radiant is to be able to reuse 
layouts in your standard Rails controllers.  Well, it's here!

With the help of John, I was able to write this extension from scratch 
today, and it is pretty well tested.  I invite you to try it out and 
give me your feedback.  You can download the extension from the main 
Radiant repository:

http://dev.radiantcms.org/svn/radiant/trunk/extensions/share_layouts

The README has a little more detail, but here's the basic way to use it:

class MyController < ApplicationController
  radiant_layout 'Main'
end

This will make all your actions from that controller be rendered within 
the Radiant Layout named 'Main'.  'content_for' blocks are mapped to 
page parts, e.g. a content_for :sidebar block will be accessed via 
<r:content part="sidebar" /> in the Layout.  The total result of your 
template, a.k.a. @content_for_layout, maps to the 'body' part, or 
<r:content />.  If your Layout has <r:title /> or <r:breadcrumbs /> 
invocations in it, you can assign these in your controller/view with 
@title and @breadcrumbs respectively.  You may also use content_for 
:title/:breadcrumbs if you prefer.

Cheers!

Sean
_______________________________________________
Radiant mailing list
Post:   [email protected]
Search: http://radiantcms.org/mailing-list/search/
Site:   http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to