# Custom Tags and Shared Layout

**URL:** <https://www.ruby-forum.com/t/custom-tags-and-shared-layout/119011>\
**Category:** Radiant CMS\
**Created:** [November 2, 2007, 4:57am UTC](https://www.ruby-forum.com/t/custom-tags-and-shared-layout/119011 "2007-11-02T04:57:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bouldr-matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/85e7bf/32.png) [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Post date:** [November 2, 2007, 4:57am UTC](https://www.ruby-forum.com/t/custom-tags-and-shared-layout/119011/1 "2007-11-02T04:57:20Z")

</div>

I’ve successfully set up my application to use the shared\_layout  
extension. This really is great because previously we had two Rails  
applications: the radiant one for static content and the rails one for  
dynamic content. However they both had to appear as one on the site,  
and so there was a lot of duplication of layout.

So right now my Radiant app has two extensions:

/vendor/extensions/shared\_layout  
/vendor/extensions/dynamic

With the ‘dynamic’ one being my old Rails app. Everything has worked  
great so far, but I am now trying to write a custom tag but am having  
trouble getting to the session object.

Now I’ve already turned on sessions for Radiant using:

def activate  
Page.send :include, UserStatusTags  
SiteController.class\_eval { session :on }  
end

in my extension config file. And I actually can get to the session  
object when the tag is processed through Radiant controllers by  
accessing the tag.globals.page.request attribute.

However when the same tag is processed through one of my controllers,  
the request object isn’t even present. Any ideas how to solve this?
