Giter Club home page Giter Club logo

spree_static_content's Introduction

Spree Static Content

Build Status

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.

Basic Installation

For Spree HEAD

  1. Add the following to your Gemfile
gem 'spree_static_content', :github => 'spree/spree_static_content'
  1. Run bundle install
  2. To copy and apply migrations run: rails g spree_static_content:install

For Spree 1.3.x

  1. Add the following to your Gemfile
gem 'spree_static_content', :github => 'spree/spree_static_content', :branch => '1-3-stable'
  1. Run bundle install
  2. To copy and apply migrations run: rails g spree_static_content:install

For Spree 1.2.x

  1. Add the following to your Gemfile
gem 'spree_static_content', :github => 'spree/spree_static_content', :branch => '1-2-stable'
  1. Run bundle install
  2. To copy and apply migrations run: rails g spree_static_content:install

For Spree 1.1.x

  1. Add the following to your Gemfile
gem 'spree_static_content', :github => 'spree/spree_static_content', :branch => '1-1-stable'
  1. Run bundle install
  2. To copy and apply migrations run: rails g spree_static_content:install

For Spree 1.0.x

  1. Add the following to your Gemfile
gem 'spree_static_content', :github => 'spree/spree_static_content', :branch => '1-0-stable'
  1. Run bundle install
  2. To copy and apply migrations run: rails g spree_static_content:install

Development

  1. fork the repo here: https://github.com/spree/spree_static_content
  2. inside your fork run bundle install
  3. make sure the tests can run on your system run : bundle exec rake test_app && bundle exec rspec spec

You can also run bundle exec rake test_app and then to run the specs run bundle exec rake

Fix bugs or add functionality

  1. create a feature branch
  git checkout -b my-feature-branch
  1. Apply your changes and add specs.
  2. Push the feature branch to your fork:
  git push -u origin my-feature-branch
  1. Send a pull request from your feature branch in the forked repository on github.

spree_static_content's People

Contributors

peterberkenbosch avatar romul avatar jdutil avatar swistak avatar lbrapid avatar ethier avatar johanb avatar radar avatar bregor avatar eliotsykes avatar joren avatar iloveitaly avatar priidikvaikla avatar schof avatar pex avatar nikolaenkov avatar tgmcclen avatar joeyjoejoejr avatar jsqu99 avatar gudata avatar greinacker avatar buddhi-desilva avatar bdq avatar alexshuhin avatar wesrog avatar futhr avatar steveroot avatar kpitn avatar pkordel avatar chipiga avatar

Watchers

Robert Massaioli avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.