Spree Commerce Blog Plugin

A online shop recently wanted me to build a blogging solution for their Spree website. Spree in an open source e-commerce framework written in Ruby-on-Rails. We didn’t need advanced functionality for the blog, just some posts with HTML content and the ability to assign tags, generate latest post lists, and a couple of other features.

A full featured framework, like WordPress would easily provide the blogging functionality, but having the blog integrated into the same website provides more scope to easily promote products on the blog pages and show latest blog entries on the shop pages. It also maintains a single admin panel for the whole website.

Spree Blog Plugin Admin

Spree Commerce Blogging Plugin Admin

The Spree Blogging Spree plugin on Github.com seemed to have much of the basic functionality required, but was a too out of date, so I forked the plugin and set to work. As the layout of the extension was out of date, I created a new blank extension for Spree 1.2 and copied over the files. Tests were replaced with RSpec tests and some new ones added. A couple of plugins were replaced by newer alternatives, such as is_taggable was replaced with acts-as-taggable-on.

I created some widgets to be used on the website front end, such as the tag cloud, recent tweets list, and an RSS feed. These can be included where appropriate within other pages on the site, or over-ridden to provide the required functionality. There are now branches for the different Spree versions, and I’ve integrated it with travis-ci.org, so that the tests get automatically run on each push of new code to Gitub and I get alerted if there are any issues. Check it out on Github: github.com/stefansenk/spree-blogging-spree.

No commenting solution currently exists. One option is to use the Disqus commenting system. This can easily be achieved by overriding the comments partial.

If you enjoyed this post, consider leaving a comment or subscribing to the RSS feed.
This site uses cookies. Find out more about cookies.