Permalink
Browse files

Now how did that happen?

  • Loading branch information...
1 parent c22edb1 commit b91cd321082eb73702670d0b42b6febe3c85a16c Steven Heidel committed Feb 18, 2011
Showing with 55 additions and 0 deletions.
  1. +55 −0 doc/guides/4 - Customising your Design/1 - How to change Page Parts.textile
@@ -0,0 +1,55 @@
+h2. How to change Page Parts
+
+Refinery sets up two default page parts +Body+ and +Side Body+. Sometimes this is not suitable for your project. This guide will show you how to:
+
+* Change the default page parts to be something else
+* Add a new page part to a single page
+
+endprologue.
+
+h3. Changing default Page Parts
+
+Refinery by default provides you with +Body+ and +Side Body+ page parts because most pages have a two column style layout. If your layout has three content areas or one, you're going to want to update this setting to reflect that.
+
+In Refinery's backend, go to the "Settings" tab. Look for a setting called "Default Page Parts" and click on the edit link. The value of this setting will look like this:
+
+NOTE: If you don't have this setting, try creating a new page and then restarting your web server.
+
+<yaml>
+---
+- Body
+- Side Body
+</yaml>
+
+Edit this YAML to have the names of the default page parts you want, click +Save+ and you're done.
+
+Here's a sample of a site that would have three content areas on most of its pages.
+
+<yaml>
+---
+- Left Body
+- Middle Body
+- Right Body
+</yaml>
+
+h3. Changing Part Parts for a single page
+
+Often we find our home pages have three or more page parts but the rest of the site only needs two. In this situation you just want to have the default page parts set to Body and Side Body and your home page setup to have an extra one.
+
+Refinery supports the ability for the user to add new Page Parts on the fly when editing a page.
+
+To add a new Page Part just to the home page, first we need to go into the "Settings" tab in Refinery. Find the setting named "New Page Parts" and set its value to +true+.
+
+Now go to your "Pages" tab in Refinery and edit your home page. You'll notice a plus and minus button at the top right of the visual editor. Click on the plus icon and add a new page part titled "Middle Body" and click save. A new visual editor will appear in a tab called "Middle Body" ready to use just for this page.
+
+NOTE: Your "middle body" content won't show on the front end yet. You need to output the content of that page part in the view.
+
+Now in your +app/views/pages/home.html.erb+ view you'll be able to put:
+
+<erb>
+<%= @page[:middle_body] %>
+</erb>
+
+to output this new content area in the view.
+
+NOTE: If you don't have a +app/views/pages/home.html.erb+ view already, run +rake refinery:override view=pages/home+ to copy it into your app.

0 comments on commit b91cd32

Please sign in to comment.