Does anyone have any good information or examples of using multiple css layouts to setup, say, a two-column design and a three-column design. So I could ''flip a switch'' and have the design go from a two-column layout to a three-column layout. Ideally I''d like to set it up so that there can be separate directories of these layouts (themes ?) . Any info or pointers are greatly appreciated. Thanks Matt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
http://www.glish.com/css/ this is a good article http://www.stopdesign.com/log/2005/06/24/zoom-layout.html On 12/16/06, matt <matt-SaPSgiKzPPtdsTMtEp03Dg@public.gmane.org> wrote:> > > Does anyone have any good information or examples of using multiple css > layouts to setup, say, a two-column design and a three-column design. > > So I could ''flip a switch'' and have the design go from a two-column > layout to a three-column layout. > > Ideally I''d like to set it up so that there can be separate directories > of these layouts (themes ?) . > > Any info or pointers are greatly appreciated. > > Thanks > > Matt > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Let me clarify. I am quite familiar with CSS, but what I''m need are examples of doing things ''the Rails way'' for instance, do I need to have different ''layout'' files, or do I need my normal layout file, with a bunch of ''if(@columns == 2) then elseif (@columns==3) end etc.... or is this something that I should implement in the controller code? I''d like to have an ''admin'' page,where an administrator of a site could re-design a site himself by specifying 2 or 3 column layout. Sort of like some of the "Do-it-yourself" online shopping carts that allow for a templatized design to be made based on certain input parameters (like # of columns, colors, font size, etc) Sorry I wasn''t clear in my first post. I hope my clarification will draw out more response. Thanks Matt On Sat, 2006-12-16 at 14:29 -0600, John Ivanoff wrote:> http://www.glish.com/css/ > > this is a good article > http://www.stopdesign.com/log/2005/06/24/zoom-layout.html > > > On 12/16/06, matt <matt-SaPSgiKzPPtdsTMtEp03Dg@public.gmane.org> wrote: > > > > > > Does anyone have any good information or examples of using multiple css > > layouts to setup, say, a two-column design and a three-column design. > > > > So I could ''flip a switch'' and have the design go from a two-column > > layout to a three-column layout. > > > > Ideally I''d like to set it up so that there can be separate directories > > of these layouts (themes ?) . > > > > Any info or pointers are greatly appreciated. > > > > Thanks > > > > Matt > > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Matt, I think that both of your ideas could work. I would recommend taking the route that requires less code. If your 2 layout schemes are mostly the same, then use one layout with code checks to turn on/off features as needed. If your 2 layouts are completely different then using 2 layout files is likely the easier choice. Aaron On Dec 16, 11:26 pm, matt <m...-SaPSgiKzPPtdsTMtEp03Dg@public.gmane.org> wrote:> Let me clarify. I am quite familiar with CSS, but what I''m need are > examples of doing things ''the Rails way'' > > for instance, do I need to have different ''layout'' files, or do I need > my normal layout file, with a bunch of ''if(@columns == 2) then elseif > (@columns==3) end etc.... > > or is this something that I should implement in the controller code? > > I''d like to have an ''admin'' page,where an administrator of a site could > re-design a site himself by specifying 2 or 3 column layout. Sort of > like some of the "Do-it-yourself" online shopping carts that allow for a > templatized design to be made based on certain input parameters (like # > of columns, colors, font size, etc) > > Sorry I wasn''t clear in my first post. I hope my clarification will > draw out more response. > > Thanks > > Matt > > On Sat, 2006-12-16 at 14:29 -0600, John Ivanoff wrote: > >http://www.glish.com/css/ > > > this is a good article > >http://www.stopdesign.com/log/2005/06/24/zoom-layout.html > > > On 12/16/06, matt <m...-SaPSgiKzPPtdsTMtEp03Dg@public.gmane.org> wrote: > > > > Does anyone have any good information or examples of using multiple css > > > layouts to setup, say, a two-column design and a three-column design. > > > > So I could ''flip a switch'' and have the design go from a two-column > > > layout to a three-column layout. > > > > Ideally I''d like to set it up so that there can be separate directories > > > of these layouts (themes ?) . > > > > Any info or pointers are greatly appreciated. > > > > Thanks > > > > Matt--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
The way I do this is to scan the stylesheet directory for .css and put those entries in a drop down where the value and name is the filename w/o the extension the user can then use the drop down from their edit user info in your rhtml you want to skin just put a variable in a stylesheet tag that refers to that user info and youre done -----Original Message----- From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of Aaron Sent: Saturday, December 16, 2006 10:42 PM To: Ruby on Rails: Talk Subject: [Rails] Re: CSS Layout integration Matt, I think that both of your ideas could work. I would recommend taking the route that requires less code. If your 2 layout schemes are mostly the same, then use one layout with code checks to turn on/off features as needed. If your 2 layouts are completely different then using 2 layout files is likely the easier choice. Aaron On Dec 16, 11:26 pm, matt <m...-SaPSgiKzPPtdsTMtEp03Dg@public.gmane.org> wrote:> Let me clarify. I am quite familiar with CSS, but what I''m need are > examples of doing things ''the Rails way'' > > for instance, do I need to have different ''layout'' files, or do I need > my normal layout file, with a bunch of ''if(@columns == 2) then elseif > (@columns==3) end etc.... > > or is this something that I should implement in the controller code? > > I''d like to have an ''admin'' page,where an administrator of a site could > re-design a site himself by specifying 2 or 3 column layout. Sort of > like some of the "Do-it-yourself" online shopping carts that allow for a > templatized design to be made based on certain input parameters (like # > of columns, colors, font size, etc) > > Sorry I wasn''t clear in my first post. I hope my clarification will > draw out more response. > > Thanks > > Matt > > On Sat, 2006-12-16 at 14:29 -0600, John Ivanoff wrote: > >http://www.glish.com/css/ > > > this is a good article > >http://www.stopdesign.com/log/2005/06/24/zoom-layout.html > > > On 12/16/06, matt <m...-SaPSgiKzPPtdsTMtEp03Dg@public.gmane.org> wrote: > > > > Does anyone have any good information or examples of using multiplecss> > > layouts to setup, say, a two-column design and a three-column design. > > > > So I could ''flip a switch'' and have the design go from a two-column > > > layout to a three-column layout. > > > > Ideally I''d like to set it up so that there can be separatedirectories> > > of these layouts (themes ?) . > > > > Any info or pointers are greatly appreciated. > > > > Thanks > > > > Matt--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Sun, 2006-12-17 at 03:52 -0800, Clayton Cottingham wrote:> > The way I do this is to scan the stylesheet directory for .css and put those > entries in a drop down where the value and name is the filename w/o the > extension > the user can then use the drop down from their edit user infoOK. I understand this part. no problem selecting css files.> > in your rhtml you want to skinI''m not sure of you mean by this. I don''t know what a skin is.> > just put a variable in a stylesheet tag that refers to that user info and > youre done >This I don''t understand. Is this what you mean by ''skin''? This variable would be initialized in the controller code I presume.... I''m not sure of how you are handing this variable to a stylesheet_link_tag, I don''t see how to give it this extra argument. Matt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Dec 17, 6:54 am, matt <m...-SaPSgiKzPPtdsTMtEp03Dg@public.gmane.org> wrote:> On Sun, 2006-12-17 at 03:52 -0800, Clayton Cottingham wrote: > This variable would be initialized in the controller code I presume.... > I''m not sure of how you are handing this variable to a > stylesheet_link_tag, I don''t see how to give it this extra argument. >Matt, You don''t need to pass an extra argument just put the stylesheet name in a variable like this: @stylesheet = "FancyStylesheet" <%= stylesheet_link_tag @stylesheet %> There are lots of ways to do this. You could setup an @stylesheet variable in your controller using an application wide before_filter to ensure its always available. Another possibility would be to store the stylesheet in the user''s session: <%= stylesheet_link_tag (session[:stylesheet] || "default") %> Actually, I just reread your entries above and realized you want a site-wide setting, not user specific. In that case I would not use the session. If you are going to have a number of settings that control how the interface works then you may want to wrap this functionality in a model. That makes it easy to store the settings in the database and update them with a web interface. You could pull the settings out with a before_filter or just access them right from the view like this: <%= stylesheet_link_tag SiteLayout.stylesheet %> Where "SiteLayout" is the name of your model and "stylesheet" is a method you have defined that returns the current stylesheet. Aaron --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I use this plugin: http://nested-layouts.rubyforge.org/ So I have a master "application.rhtml" wrapper layout and nested "single_col" / "two_col" / "three_col" etc. layouts. Then in my view I just write a few blocks like this: <% content_for "left_column" do %> <h1>Left column content</h1> <% end %> <% inside_layout ''two_col'' do %> <h1>Main content</h1> <% end %> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---