Manage static pages for Spree Commerce.
Ruby HTML CSS JavaScript
Pull request Compare This branch is 56 commits ahead of pero-ict-solutions:master.
Latest commit 41ea4c0 Dec 15, 2016 @damianlegawiec damianlegawiec committed on GitHub Merge pull request #224 from spree-contrib/revert-213-static-page-pro…
…motions

Revert "Fire Spree::PromotionHandler::Page on static page show"
Permalink
Failed to load latest commit information.
app Revert "Fire Spree::PromotionHandler::Page on static page show" Dec 15, 2016
bin Minor engine tweaks. Dec 29, 2014
config Add Ukrainian locale. Sep 13, 2016
db/migrate Delete pages_in_footer.rb and _static_content_footer.html.erb Feb 26, 2016
gemfiles Setup appraisals to test against Spree 3.1, 3.2 and 3.3 on Travis CI Dec 15, 2016
lib bump version to 3.2.0.alpha, bump spree_core dependency version to 3.… Apr 8, 2016
spec Revert "Fire Spree::PromotionHandler::Page on static page show" Dec 15, 2016
.gitignore Setup appraisals to test against Spree 3.1, 3.2 and 3.3 on Travis CI Dec 15, 2016
.hound.yml replace deprecated SingleSpaceBeforeFirstArg with SpaceBeforeFirstArg… Mar 2, 2016
.rspec Update spec support for RSpec 3.1.x Dec 29, 2014
.rubocop.yml Add support config for Hound CI. Dec 29, 2014
.travis.yml Setup appraisals to test against Spree 3.1, 3.2 and 3.3 on Travis CI Dec 15, 2016
Appraisals We don't need spree_auth_devise Dec 15, 2016
CHANGELOG.md Update docs to reflect current branch and repo. Dec 29, 2014
CONTRIBUTING.md Better contributors guidelines. Jan 25, 2015
Gemfile bump version to 3.2.0.alpha, bump spree_core dependency version to 3.… Apr 8, 2016
Guardfile Update spec support for RSpec 3.1.x Dec 29, 2014
LICENSE.md Update docs to reflect current branch and repo. Dec 29, 2014
README.md Updated installation instructions Dec 15, 2016
Rakefile Minor engine tweaks. Dec 29, 2014
spree_static_content.gemspec Setup appraisals to test against Spree 3.1, 3.2 and 3.3 on Travis CI Dec 15, 2016

README.md

Spree Static Content

Build Status Code Climate

Good, clean content management of pages for Spree. You can use this to:

  • Add and manage static pages such as an 'About' page.
  • Show a static page instead of existing dynamic pages such as the home page, products pages, and taxon pages.

HowTo

Using the 'Pages' option in the admin tab, you can add static pages to your Spree install. The page content can be pulled directly from the database, be a separate layout file or rendered as a partial.

In the admin tab, use the 'New page' option to create a new static page.

The title, slug, body, and meta fields will replace their respective page elements on load. The title, slug and body element are all required fields.

Body text provided without a layout / partial being specified will be loaded in the spree_application layout after it is pulled from the database.

Layout and Partial Rendering

To render an entire page without the spree_application layout, specify a relative path to the layout file (eg. spree/layouts/layout_file_name). This file will not be prefixed with an underscore as it is a layout, not a partial.

To render a partial, specify the path in the layout file name and check the 'Render layout as partial' option. The path specified in the layout area will not have an underscore, but it will be required in the filename.

Also note the availability of the render_snippet helper which finds a page by its slug and renders the raw page body anywhere in your view.

Options

Use the 'Show in' checkboxes to specify whether to display the page links in the header, footer or sidebar. The position setting alters the order in which they appear.

Finally, toggle the visibility using the 'Visible' checkbox. If it is unchecked, the page will not be available.


Installation

  1. Add this extension to your Gemfile with this line:

    Spree >= 3.1

    gem 'spree_static_content', github: 'spree-contrib/spree_static_content'

    Spree 3.0 and Spree 2.x

    gem 'spree_static_content', github: 'spree-contrib/spree_static_content', branch: 'X-X-stable'

    The branch option is important: it must match the version of Spree you're using. For example, use 3-0-stable if you're using Spree 3-0-stable or any 3.0.x version.

  2. Install the gem using Bundler:

    bundle install
  3. Copy & run migrations

    bundle exec rails g spree_static_content:install
  4. Restart your server

    If your server was running, restart it so that it can find the assets properly.


Contributing

See corresponding guidelines


Copyright (c) 2008-2015 Peter Berkenbosch and contributors, released under the New BSD License