|
1 |
| -# solidus_static_content |
2 |
| -Completely based on spree_static_content |
| 1 | +# Spree Static Content |
| 2 | + |
| 3 | +[](https://travis-ci.org/spree-contrib/spree_static_content) |
| 4 | +[](https://codeclimate.com/github/spree-contrib/spree_static_content) |
| 5 | + |
| 6 | +Good, clean content management of pages for Spree. You can use this to: |
| 7 | + |
| 8 | +- Add and manage static pages such as an 'About' page. |
| 9 | +- Show a static page instead of existing dynamic pages such as the home page, |
| 10 | + products pages, and taxon pages. |
| 11 | + |
| 12 | +## HowTo |
| 13 | + |
| 14 | +Using the 'Pages' option in the admin tab, you can add static pages to your Spree install. The page content can |
| 15 | +be pulled directly from the database, be a separate layout file or rendered as a partial. |
| 16 | + |
| 17 | +In the admin tab, use the 'New page' option to create a new static page. |
| 18 | + |
| 19 | +The title, slug, body, and meta fields will replace their respective page elements on load. The title, slug and |
| 20 | +body element are all required fields. |
| 21 | + |
| 22 | +Body text provided without a layout / partial being specified will be loaded in the spree_application layout after |
| 23 | +it is pulled from the database. |
| 24 | + |
| 25 | +**Layout and Partial Rendering** |
| 26 | + |
| 27 | +To render an entire page without the spree_application layout, specify a relative path to the layout file (eg. |
| 28 | +`spree/layouts/layout_file_name`). This file will not be prefixed with an underscore as it is a layout, not a partial. |
| 29 | + |
| 30 | +To render a partial, specify the path in the layout file name and check the 'Render layout as partial' option. The |
| 31 | +path specified in the layout area will not have an underscore, but it will be required in the filename. |
| 32 | + |
| 33 | +Also note the availability of the render_snippet helper which finds a page by its slug and renders the raw page |
| 34 | +body anywhere in your view. |
| 35 | + |
| 36 | +**Options** |
| 37 | + |
| 38 | +Use the 'Show in' checkboxes to specify whether to display the page links in the header, footer or sidebar. The |
| 39 | +position setting alters the order in which they appear. |
| 40 | + |
| 41 | +Finally, toggle the visibility using the 'Visible' checkbox. If it is unchecked, the page will not be available. |
| 42 | + |
| 43 | +## Basic Installation |
| 44 | + |
| 45 | +Add to your `Gemfile`: |
| 46 | + |
| 47 | +```ruby |
| 48 | +gem 'spree_static_content', github: 'spree-contrib/spree_static_content', branch: '2-4-stable' |
| 49 | +``` |
| 50 | + |
| 51 | +Run: |
| 52 | + |
| 53 | + bundle install |
| 54 | + rails g spree_static_content:install |
| 55 | + |
| 56 | +That's all! |
| 57 | + |
| 58 | +**NOTE: Check [Versionfile][1] for corresponding gem `branch` for your Spree version.** |
| 59 | + |
| 60 | +## Contributing |
| 61 | + |
| 62 | +In the spirit of [free software][2], **everyone** is encouraged to help improve this project. |
| 63 | + |
| 64 | +Here are some ways *you* can contribute: |
| 65 | + |
| 66 | +* by using prerelease versions |
| 67 | +* by reporting [bugs][3] |
| 68 | +* by suggesting new features |
| 69 | +* by writing translations |
| 70 | +* by writing or editing documentation |
| 71 | +* by writing specifications |
| 72 | +* by writing code (*no patch is too small*: fix typos, add comments, clean up inconsistent whitespace) |
| 73 | +* by refactoring code |
| 74 | +* by resolving [issues][3] |
| 75 | +* by reviewing patches |
| 76 | + |
| 77 | +Starting point: |
| 78 | + |
| 79 | +* Fork the repo |
| 80 | +* Clone your repo |
| 81 | +* Run `bundle install` |
| 82 | +* Run `bundle exec rake test_app` to create the test application in `spec/test_app` |
| 83 | +* Make your changes |
| 84 | +* Ensure specs pass by running `bundle exec rspec spec` |
| 85 | +* Submit your pull request |
| 86 | + |
| 87 | +Copyright (c) 2014 [Peter Berkenbosch][4] and [contributors][5], released under the [New BSD License][6] |
| 88 | + |
| 89 | +[1]: https://github.com/spree-contrib/spree_static_content/blob/master/Versionfile |
| 90 | +[2]: http://www.fsf.org/licensing/essays/free-sw.html |
| 91 | +[3]: https://github.com/spree-contrib/spree_static_content/issues |
| 92 | +[4]: https://github.com/peterberkenbosch |
| 93 | +[5]: https://github.com/spree-contrib/spree_static_content/graphs/contributors |
| 94 | +[6]: https://github.com/spree-contrib/spree_static_content/blob/master/LICENSE.md |
0 commit comments