Skip to content

Latest commit

 

History

History
70 lines (53 loc) · 1.9 KB

README.md

File metadata and controls

70 lines (53 loc) · 1.9 KB

SpreeComfy

Build Status

Content management system based on comfortable-mexican-sofa for spree commerce. This is not a spree_static_content, it is a full-fledged CMS with image upload, page templates and a tree structure of content.

spree >= 3-6-stable

Installation

Gemfile:

# order is important
gem 'spree'
gem 'comfortable_mexican_sofa'
gem 'spree_comfy', branch: 'integrated', github: 'hazg/spree_comfy'
gem 'spree_auth_devise'

Run bundler:

bundle

Generate installs:

bundle exec rails generate comfy:cms
bundle exec rails generate spree_comfy:install
bundle exec rails generate spree:install --user_class=Spree::User

Now take a look inside your config/routes.rb file. You'll see where routes attach for the admin area and content serving. Make sure that content serving route appears as a very last item or it will make all other routes to be inaccessible.

mount Spree::Core::Engine, at: '/'
mount SpreeComfy::Engine, at: '/'

comfy_route :cms_admin, path: '/admin'
comfy_route :cms, path: '/', sitemap: false

Use

Render snippets:

= comfy_snippet('snippet-identifier')

Creating navigation: add category (for ex. "In top menu"), add {{ cms:page:menu_name:string }} to pages layout.

ul#top-menu
  - cms_site.pages.for_category('In top menu').each do |page|
    li
      - if not (label = cms_block_content('menu_name', page)).empty?
        a href=page.full_path =label
      - else
        a href=page.full_path =page.label

Auth with devise

https://github.com/hazg/spree_comfy_auth_devise

Copyright (c) 2014-2019 Aleksandr Aleksandrov, released under the New BSD License