README.rdoc in manageable_content-0.2.5 vs README.rdoc in manageable_content-0.2.6
- old
+ new
@@ -54,9 +54,30 @@
If you need a content that all your controllers will have (for example, a 'title' content), you can add the configuration to your parent controller and all controllers that inherit from it will also have that content. For example, you could add this to your ApplicationController:
manageable_content_for :title
+=== Custom contents
+
+If you need custom pages that are not directly controller related, you can configure them using an initializer:
+
+ ManageableContent::Engine.config.custom_pages = {
+ "static/page1" => {:body => :text},
+ "static/page2" => {:body => :text, :footer => :string}
+ }
+
+This work in the same way as controller pages. The example above would create two pages with the keys
+"static/page1" and "static/page2" respectivelly.
+
+To be able to use the helpers to retrieve the content, the controller responsible for the static pages
+has to tell manageable_content what page key it will be looking for. You can do that with the following code:
+
+ manageable_content_custom_key do
+ params[:page]
+ end
+
+This will use the params[:page] as the page key to be used by the manageable_content_for helper.
+
=== Layout contents
Supposing that your application will have a 'footer' content that should be the same in all of your controllers, you would add this to your ApplicationController:
manageable_layout_content_for :footer
\ No newline at end of file