# Programmatically getting access to the layout?

**URL:** <https://www.ruby-forum.com/t/programmatically-getting-access-to-the-layout/98783>\
**Category:** Radiant CMS\
**Created:** [July 18, 2006, 5:30am UTC](https://www.ruby-forum.com/t/programmatically-getting-access-to-the-layout/98783 "2006-07-18T05:30:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fbeausoleil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ec9cab/32.png) [@fbeausoleil](https://www.ruby-forum.com/u/fbeausoleil)\
**Post date:** [July 18, 2006, 5:30am UTC](https://www.ruby-forum.com/t/programmatically-getting-access-to-the-layout/98783/1 "2006-07-18T05:30:44Z")

</div>

Hi !

I am looking into using RadiantCMS in another software. The admins  
will manage the content using RadiantCMS, while I will generate views.  
Think E-Commerce.

Obviously, I’d like the layouts to be defined only once – DRY. Is  
there a pre-defined way to get to the layout and reuse it in regular  
Rails views ?

Please note I haven’t dug into the code yet, but since this is  
something I need, I would be interested in coding it if need be.

Thanks !

---

<div class="post-metadata">

**Author:** ![fbeausoleil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ec9cab/32.png) [@fbeausoleil](https://www.ruby-forum.com/u/fbeausoleil)\
**Post date:** [July 18, 2006, 3:37pm UTC](https://www.ruby-forum.com/t/programmatically-getting-access-to-the-layout/98783/2 "2006-07-18T15:37:34Z")

</div>

Francois B. wrote:

> I am looking into using RadiantCMS in another software. The admins  
> will manage the content using RadiantCMS, while I will generate views.  
> Think E-Commerce.
> 
> Obviously, I’d like the layouts to be defined only once – DRY. Is  
> there a pre-defined way to get to the layout and reuse it in regular  
> Rails views ?

Not at the moment. If you are interested in making this work take a look  
at #process on Behavior::Base:

[http://dev.radiantcms.org/radiant/browser/trunk/radiant/app/models/behavior.rb](http://dev.radiantcms.org/radiant/browser/trunk/radiant/app/models/behavior.rb)

If the software you are creating is radically different from Radiant,  
you could just use Radius within your own administration system. Radius  
is the library that Radiant uses to process the \<r:tag\_name /\> tags:

[http://radius.rubyforge.org](http://radius.rubyforge.org)

–  
John L.  
[http://wiseheartdesign.com](http://wiseheartdesign.com)

---

<div class="post-metadata">

**Author:** ![fbeausoleil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ec9cab/32.png) [@fbeausoleil](https://www.ruby-forum.com/u/fbeausoleil)\
**Post date:** [July 18, 2006, 3:53pm UTC](https://www.ruby-forum.com/t/programmatically-getting-access-to-the-layout/98783/3 "2006-07-18T15:53:26Z")

</div>

Francois  
There was some discussion of this a while ago. Andrew H. had  
some  
useful advise, have a look at this  
[http://www.ruby-forum.com/topic/71319#new](http://www.ruby-forum.com/topic/71319#new)

Harvey  
On 18/7/06 14:46, “Francois B.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi !

2006/7/18, John W. Long [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> at #process on Behavior::Base:
> 
> [http://dev.radiantcms.org/radiant/browser/trunk/radiant/app/models/behavior.rb](http://dev.radiantcms.org/radiant/browser/trunk/radiant/app/models/behavior.rb)
> 
> If the software you are creating is radically different from Radiant,
> 
> you could just use Radius within your own administration system. Radius  
> is  
> the library that Radiant uses to process the \<r:tag\_name /\> tags:

No, it is

> not radically different. I just need a CMS that goes around  
> the parts that I  
> code. My first task will be attempting to make  
> Radiant an Engine or a plugin,  
> so I can integrate it with my own  
> application.

I will look at how to get the

> layout programmatically.

## Thanks !

François

> Beausoleil  
> [http://blog.teksol.info/](http://blog.teksol.info/)

* * *

> * * *

Radiant mailing

> list  
> removed\_email\_address@domain.invalid  
> [http://lists.radiantcms.org/mailman/listinfo](http://lists.radiantcms.org/mailman/listinfo)  
> /radiant

This e-mail has been scanned for all viruses by MessageLabs.

This e-mail has been scanned for all viruses by MessageLabs.

---

<div class="post-metadata">

**Author:** ![fbeausoleil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ec9cab/32.png) [@fbeausoleil](https://www.ruby-forum.com/u/fbeausoleil)\
**Post date:** [July 18, 2006, 4:05pm UTC](https://www.ruby-forum.com/t/programmatically-getting-access-to-the-layout/98783/4 "2006-07-18T16:05:52Z")

</div>

2006/7/18, Harvey B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> There was some discussion of this a while ago. Andrew H. had some  
> useful advise, have a look at this [http://www.ruby-forum.com/topic/71319#new](http://www.ruby-forum.com/topic/71319#new)

Great, just what I needed.

Bye !

---

<div class="post-metadata">

**Author:** ![fbeausoleil](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ec9cab/32.png) [@fbeausoleil](https://www.ruby-forum.com/u/fbeausoleil)\
**Post date:** [July 18, 2006, 3:47pm UTC](https://www.ruby-forum.com/t/programmatically-getting-access-to-the-layout/98783/5 "2006-07-18T15:47:22Z")

</div>

Hi !

2006/7/18, John W. Long [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> If the software you are creating is radically different from Radiant,  
> you could just use Radius within your own administration system. Radius  
> is the library that Radiant uses to process the \<r:tag\_name /\> tags:

No, it is not radically different. I just need a CMS that goes around  
the parts that I code. My first task will be attempting to make  
Radiant an Engine or a plugin, so I can integrate it with my own  
application.

I will look at how to get the layout programmatically.

Thanks !
