On Jul 16, 2009, at 13:01 , Mamed Mamedov wrote:

Hi everybody!

I have a little question: how can I change page's layout from within my
extension?

Something like this:

def activate

      Page.class_eval do
        def process_with_session_layout(request, response)
          self.layout = Layout.find(controller.session[:layout_id[)
          process_without_session_layout(request, response)
        end
        alias_method_chain :process, :session_layout
      end

.end

Problem is, that I have 2 different page layouts for my site: [ full- version
and light-version ].
I want to write a mini-extension to switch between designs of my site throw
hitting: /design/set/full and /design/set/light or /design/reset
And I'am saving current design variable in current user's session.

And now, just need to change current page's layout on the fly accordingly to
session value.
________________
Regards,
Mamed Mamedov
_______________________________________________
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