README.md in cardboard_cms-0.2.2 vs README.md in cardboard_cms-0.3.1

- old
+ new

@@ -14,10 +14,14 @@ * Super easy to extend and customize * It's like your favorite admin interface gem just had a baby with a CMS ![alt text](https://github.com/smashingboxes/cardboard/wiki/images/2a.jpg "screenshot1") + +## Updating from 0.2 -> 0.3 +Some changes were made to the database. Before updating make sure to have a look at the [new migration](https://github.com/smashingboxes/cardboard/blob/master/db/migrate/1_create_cardboard.rb) + ## Requirements * An authentication solution. For example, [here is what you need to do](https://github.com/plataformatec/devise#getting-started) to get `Devise` installed. * `imagemagick` (on mac do `brew install imagemagick`) * `Rails 4` and `Ruby 2.0` @@ -43,11 +47,11 @@ ``` ## Usage ### Get a page -Add a file in your `app/views/templates` with filename matching the identifier of the page. Inside this file you can access the page with: +Add a file in your `app/views/pages` (or `app/views/templates`) with filename matching the identifier of the page. Inside this file you can access the page with: ```ruby current_page ``` ### Fetch a page part ```ruby @@ -102,11 +106,11 @@ fields: image1: type: image required: true default: CrashTest.jpg -pages: +templates: two_column: parts: main: fields: body: @@ -122,11 +126,14 @@ ---|--- | ---|--- [parts](#parts) | hash | nil |a list of page parts title | string | identifier | name of the page as shown in the nav bar position | integer | auto-increment | position of the page on the nav bar (the lowest position is the home page!) parent_id | string | nil | identifier of the parent page (used for nested pages) +controller_action | string | pages#identifier | go to a specific controller example "blog#index". In that case, the page identifier is passed in the params +#### Templates +Templates are declared exactly like pages. They allow for the creation of pages directly from the admin interface. One key difference between templates and pages is the location of the view files which will be under `app/views/templates`. #### Parts Each part sub-section starts with the name of it's unique identifier. This name is used to reference the part in the code an thus should not change throughout the life of the project. Key | Type | Default | Definition @@ -171,19 +178,21 @@ [Ransack](https://github.com/ernie/ransack) | Object-based searching and filtering [Dragonfly](https://github.com/markevans/dragonfly) | On-the-fly image processing and file uploading ### Menu options +You can customize the menu for this resource by adding to the controller class: ```ruby menu label: "Test", priority: 1 ``` You can also choose to remove a resource from the menu ```ruby menu false ``` ### Sorting +You can customize the sorting for this resource by adding to the controller class: ```ruby default_order "name DESC" # default: 'updated_at desc' ``` You can pass any `ransack` sort order, which includes associations. Example: ```ruby @@ -279,9 +288,10 @@ ### Page Path In your controllers you may want to redirect to a specific page. You can do so with the following: ```ruby page_path("identifier_for_this_page") page_url("identifier_for_this_page") +cardboard.edit_page_path(@page) #link to let your admins edit the page they see ``` ### Meta tags (SEO) To add SEO meta tags simply add a yield as follows to your layout file: