Giter Site home page Giter Site logo

jtapia / solidus_static_content Goto Github PK

View Code? Open in Web Editor NEW

This project forked from solidusio-contrib/solidus_static_content

0.0 2.0 1.0 683 KB

:page_facing_up: Content management of pages for Spree

License: BSD 3-Clause "New" or "Revised" License

Ruby 67.52% CSS 0.71% HTML 26.70% Shell 5.07%

solidus_static_content's Introduction

Solidus Static Content

CircleCI

A fork of the Spree extension for compatibility with Solidus.

Good, clean content management of pages for Solidus. You can use it 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.

Installation

Add solidus_static_content to your Gemfile:

gem 'solidus_static_content', github: 'jtapia/solidus_static_content'

Bundle your dependencies and run the installation generator:

bundle
bundle exec rails g solidus_static_content:install

Usage

Using the 'Pages' option in the admin tab, you can add static pages to your Solidus store. The page content can be pulled directly from the database, be a separate layout file or be 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 (e.g. spree/layouts/layout_file_name). Note that the name of 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.

Development

Testing the extension

First bundle your dependencies, then run bin/rake. bin/rake will default to building the dummy app if it does not exist, then it will run specs. The dummy app can be regenerated by using bin/rake extension:test_app.

bundle
bin/rake

To run Rubocop static code analysis run

bundle exec rubocop

When testing your application's integration with this extension you may use its factories. Simply add this require statement to your spec_helper:

require 'solidus_static_content/factories'

Running the sandbox

To run this extension in a sandboxed Solidus application, you can run bin/sandbox. The path for the sandbox app is ./sandbox and bin/rails will forward any Rails commands to sandbox/bin/rails.

Here's an example:

$ bin/rails server
=> Booting Puma
=> Rails 6.0.2.1 application starting in development
* Listening on tcp://127.0.0.1:3000
Use Ctrl-C to stop

Releasing new versions

Your new extension version can be released using gem-release like this:

bundle exec gem bump -v VERSION --tag --push --remote upstream && gem release

License

Copyright (c) 2014 Peter Berkenbosch and contributors, released under the New BSD License.

solidus_static_content's People

Contributors

peterberkenbosch avatar elia avatar jhawthorn avatar aldesantis avatar romul avatar alexblackie avatar kennyadsl avatar radar avatar jdutil avatar swistak avatar jtapia avatar lbrapid avatar ethier avatar futhr avatar johanb avatar aitbw avatar bregor avatar dependabot-preview[bot] avatar iloveitaly avatar eliotsykes avatar joren avatar memotoro avatar priidikvaikla avatar quintinadam avatar rterbush avatar geekoncoffee avatar schof avatar pex avatar nikolaenkov avatar tgmcclen avatar

Watchers

James Cloos avatar  avatar

Forkers

maykazw

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.