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
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
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
https://github.com/hazg/spree_comfy_auth_devise
Copyright (c) 2014-2019 Aleksandr Aleksandrov, released under the New BSD License