[ANN] share_layouts extension

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

Nice, Sean!

If anyone prefers it the other way around, that is; wants to use an
ordinary Rails layout for their Radiant pages, this extension makes
it possible:
http://svn.casperfabricius.com/extensions/file_based_layout/

Best regards,
Casper F.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs