adding default cms seeds
Oleg
committed Feb 07, 2011
commit 7c262830144834763c64edc9bd1bebbdcecd7d5e
Showing 8
changed files with
59 additions
and 1 deletions
config/initializers/comfortable_mexican_sofa.rb
+2
-1
| @@ | @@ -15,7 +15,8 @@ ComfortableMexicanSofa.configure do |config| |
| # config.admin_route_redirect = '/cms-admin/pages' | |
| # Location of YAML files that can be used to render pages instead of pulling | |
| - | # data from the database. Not active if not specified. |
| + | # data from the database. Not active if not specified. Containing folder name |
| + | # could be the hostname of the site. Example: my-app.local |
| # config.seed_data_path = File.expand_path('db/cms_seeds', Rails.root) | |
| # Let CMS handle site creation and management. Enabled by default. | |
cms_seeds/example.local/layouts/default.yml b/db/cms_seeds/example.local/layouts/default.yml
+8
-0
| @@ | @@ -0,0 +1,8 @@ |
| + | label: Default Layout |
| + | slug: default |
| + | content: |- |
| + | <html> |
| + | <body> |
| + | {{ cms:page:content }} |
| + | </body> |
| + | </html> |
| \ No newline at end of file | |
cms_seeds/example.local/layouts/nested.yml b/db/cms_seeds/example.local/layouts/nested.yml
+6
-0
| @@ | @@ -0,0 +1,6 @@ |
| + | label: Nested Layout |
| + | slug: nested |
| + | parent: default |
| + | content: |- |
| + | <div class='left'> {{ cms:page:left }} </div> |
| + | <div class='left'> {{ cms:page:right }} </div> |
| \ No newline at end of file | |
cms_seeds/example.local/pages/child.yml b/db/cms_seeds/example.local/pages/child.yml
+10
-0
| @@ | @@ -0,0 +1,10 @@ |
| + | label: Child Page |
| + | parent: / |
| + | cms_layout: default |
| + | full_path: /child |
| + | slug: child |
| + | cms_blocks_attributes: |
| + | - |
| + | label: content |
| + | content: |- |
| + | Child Page Content |
| \ No newline at end of file | |
cms_seeds/example.local/pages/child/subchild.yml b/db/cms_seeds/example.local/pages/child/subchild.yml
+14
-0
| @@ | @@ -0,0 +1,14 @@ |
| + | label: Sub-Child Page |
| + | parent: /child |
| + | cms_layout: nested |
| + | full_path: /child/subchild |
| + | slug: subchild |
| + | cms_blocks_attributes: |
| + | - |
| + | label: left |
| + | content: |- |
| + | Sub Child Page Left Content |
| + | - |
| + | label: right |
| + | content: |- |
| + | Sub Child Page Right Content |
| \ No newline at end of file | |
cms_seeds/example.local/pages/index.yml b/db/cms_seeds/example.local/pages/index.yml
+11
-0
| @@ | @@ -0,0 +1,11 @@ |
| + | label: Home Page |
| + | parent: |
| + | cms_layout: default |
| + | full_path: / |
| + | slug: |
| + | cms_blocks_attributes: |
| + | - |
| + | label: content |
| + | content: |- |
| + | Home Page Content |
| + | {{ cms:snippet:example }} |
| \ No newline at end of file | |
cms_seeds/example.local/snippets/example.yml b/db/cms_seeds/example.local/snippets/example.yml
+4
-0
| @@ | @@ -0,0 +1,4 @@ |
| + | label: Example Snippet |
| + | slug: example |
| + | content: |- |
| + | Content for Example Snippet |
| \ No newline at end of file | |
generators/cms_generator.rb b/lib/generators/cms_generator.rb
+4
-0
| @@ | @@ -27,6 +27,10 @@ class CmsGenerator < Rails::Generators::Base |
| directory 'public/images/comfortable_mexican_sofa', 'public/images/comfortable_mexican_sofa' | |
| end | |
| + | def generate_cms_seeds |
| + | directory 'db/cms_seeds', 'db/cms_seeds' |
| + | end |
| + | |
| def show_readme | |
| readme 'lib/generators/README' | |
| end | |