The edge version of Spree has new features aimed at reducing the need to override the default Spree layout template. The title, stylesheets, and logo now can all be customized without creating your own copy of the layout. These handy new features were contributed by Eliot Sykes along with the following writeup.
New Title Methods
There are some new methods for manipulating the page title: the
set_title helper methods in
set_title to set a page title either from a controller method, or a view template. You can also override the
title methods in
Spree::BaseController for further control.
title method is used in
application.html.erb of the new release, however if you are upgrading and want to take advantage, use this in between your
<title> tags of your layout template:
<p><%= title %></p>
And to set the title in a view template:
<p><% set_title ‘My custom title’ %></p>
Customize Default Stylesheets
Spree::Config[:stylesheets] is a new config option for customizing the stylesheets used by the default application layout.
The value of
Spree::Config[:stylesheets] is a comma-separated string
of stylesheet names without the file extensions. See the customization
tutorial for more information.
If you are upgrading, to take advantage of this use the new
stylesheet_tags helper method.
Spree::Config[:logo] is a new config option for customizing the logo image path. If you are upgrading, take advantage of this by using the new
logo helper method.