Multiple Layouts in Refinery

894 katselukertaa
Siirry ensimmäiseen lukemattomaan viestiin

Fregas

lukematon,
27.10.2010 klo 10.58.3027.10.2010
vastaanottaja Refinery CMS
I'm sorry if this has been asked but i couldn't find a definitive
answer in this group. Is there a way to allow multiple layouts for
the same site, like if want 3 pages to look different then another
three pages? It doesn't have to be configurable through the user
admin, I just want a way to tell refinery that 3 CMS pages should use
a different layout than the rest of the site.

Thanks,
Craig

Philip Arndt

lukematon,
27.10.2010 klo 16.54.2827.10.2010
vastaanottaja refine...@googlegroups.com
Maarten (MoreTea) is working on a branch that does just this.
http://github.com/moretea/refinerycms/tree/rails3_page_layouts

I guess you could message him on GitHub for more information. This functionality will likely go core once it has all of the issues worked out + a clean, nice interface.

Fregas

lukematon,
28.10.2010 klo 11.18.0128.10.2010
vastaanottaja Refinery CMS
How do I replace that branch with the refinery i'm using now? Sorry
new to Rails as well as Refinery...

Craig



On Oct 27, 3:54 pm, Philip Arndt <p...@resolvedigital.co.nz> wrote:
> Maarten (MoreTea) is working on a branch that does just this.http://github.com/moretea/refinerycms/tree/rails3_page_layouts

phillipoertel

lukematon,
15.9.2011 klo 12.26.0415.9.2011
vastaanottaja refine...@googlegroups.com
Any news here? I could have used that feature, too. Right now, I'm simply overwriting PagesController#show.

Raphael Crawford-Marks

lukematon,
3.10.2011 klo 19.35.203.10.2011
vastaanottaja Refinery CMS
I'm also looking for a way to manage multiple layouts...anyone heard
anything? Trying to merge in a separate branch of refinery isn't
really practical...

Rob Yurkowski

lukematon,
30.6.2012 klo 21.25.5630.6.2012
vastaanottaja refine...@googlegroups.com
Or, conversely, you can just enable config.use_layout_templates = true, config.layout_template_whitelist = ["application", "my_layout"] inside config/initializers/refinery/pages.rb, create app/views/layouts/my_layout.html.erb, and then use the select box in the page's Advanced Options. ;)

For whatever reason, the guide doesn't appear in the site list, but you can learn more about those settings here: https://github.com/resolve/refinerycms/blob/master/doc/guides/3%20-%20Advanced%20Techniques%20and%20Tips/3%20-%20Using%20Custom%20View%20or%20Layout%20Templates.textile


On 2012-06-30, at 8:48 PM, Val Seleznev wrote:

Figured out a way to do it and though it might be useful for someone.

I extended pages controller just like in this guide: http://refinerycms.com/guides/extending-controllers-and-models-with-decorators
Since I only needed to change layout for my home page my decorator looks like this:

Refinery::PagesController.class_eval do
  layout 'home', only: [:home]
end


f I needed to define a layout for a few pages I could change it something like this:
;
Refinery::PagesController.class_eval do
  layout :resolve_layout

  private

  def resolve_layout
    case params[:path]
    when "home"
      "home"
    when "about"
      "about"
    else
      "application"
    end
  end
end

Looking at the dates in the thread... Is there a better solution for multiple layouts these days?

--
You received this message because you are subscribed to the Google
Groups "Refinery CMS" group.
To post to this group, send email to refine...@googlegroups.com
To unsubscribe from this group, send email to
refinery-cms...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/refinery-cms?hl=en
 
http://www.refinerycms.com

Philip Arndt

lukematon,
30.6.2012 klo 21.26.4530.6.2012
vastaanottaja refine...@googlegroups.com
The guide would need to be on 2-0-stable to appear.

Val Seleznev

lukematon,
30.6.2012 klo 23.27.3430.6.2012
vastaanottaja refine...@googlegroups.com
Makes it much easier indeed! Thanks heaps! :)
Vastaa kaikille
Vastaa kirjoittajalle
Välitä
0 uutta viestiä