README.markdown in spud_cms-0.8.17 vs README.markdown in spud_cms-0.9.0
- old
+ new
@@ -1,59 +1,76 @@
Spud CMS
========
Spud CMS is a CMS Engine designed to be robust, easy to use, and light weight.
-NOTE: This project is still in its early infancy.
+
Installation/Usage
------------------
1. In your Gemfile add the following
- gem 'spud_core', :git => "git://github.com/davydotcom/spud_core_admin.git"
- gem 'spud_cms', :git => "git://github.com/davydotcom/spud_cms.git"
+ gem 'spud_cms'
2. Run bundle install
3. Copy in database migrations to your new rails project
- bundle exec rake spud_core:install:migrations
- bundle exec rake spud_cms:install:migrations
+ bundle exec rake railties:install:migrations
rake db:migrate
4. Change ApplicationController to inherit from Spud::ApplicationController instead of ActionController::Base
class ApplicationController < Spud::ApplicationController
-
+
5. run a rails server instance and point your browser to /spud/admin
Routing to the CMS Engine
--------------------------
Routing your home page to the CMS engine is fairly straight forward.
-in your applications environment.rb file add a configure block as such
+in your applications application.rb file add a configure block as such
Spud::Cms.configure do |config|
config.menus_enabled = true
- config.templates_enabled = false
config.root_page_name = "home"
end
Where "home" is the page name you wish to use.
Pages will default render to the 'application' layout of your application. You can change this by using templates to specify base layouts.
+Defining Templates / Layouts
+----------------------------
+Spud CMS has recently changed its template structure. The admin templates area is no longer with us. In Spud CMS templates are defined similar to how an asset pipeline manifest is defined. At the top of your layout files a series of comments can be used to define the name of the template, and the content_for blocks that are editable by the user.
+
+Example:
+
+ <%
+ #template_name: 2 Column Page
+ #html: Left
+ #html: Right
+ %>
+
+Optionally a description can be passed as well as a `site_name: default` for multisite mode.
+
+
+Using Liquid Template Engine
+----------------------------
+Spud CMS utilizes the liquid template syntax engine created by Shopify. This allows you to easily inject variables into your pages in the page editor. Example:
+
+ <h2>{{page.name}}</h2>
+
Using Menus
-----------
A lot of cms engines allow you to render your navigation links in a ul block by using your page tree structure. In a lot of cases this is insufficient as some sites have urls that redirect to pages outside of your cms. This is where menus come in. They can be built in the spud admin control panel.
In your application layout file or any erb template you can render a ul block like so
-
- <%=sp_list_menu({:id => "navigation",:name => "Main"})%>
-
-This will output a <ul id="navigation"></ul> block for the menu you created in admin named "Main"
+ <%=sp_list_menu({:id => "navigation",:name => "Main"})%>
+This will output a <ul id="navigation"></ul> block for the menu you created in admin named "Main"
+
Adding Your Own Engines
-----------------------
Creating a rails engine that ties into spud admin is fairly straight forward
In your new engine add spud_admin as a dependency and create an initializer inside your engine class as such:
@@ -73,10 +90,10 @@
-----------------
Spud uses RSpec for testing. Get the tests running with a few short commands:
1. Create and migrate the databases:
-
+
rake db:create
rake db:migrate
2. Load the schema in to the test database: