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.
  • Stanislav A. Bourakov

    Dear Stephen, thank you for the excellent work. I made new translate file, based on your en-version, but get the error:

    ActionView::Template::Error (translation missing: ru.time.formats.blog_date):
    23: <tr class="” id=””>
    24: :blog_date) if blog_entry.published_at %>

    Could you assist in solving the problem?

  • Hi Stanislav. Sounds like there my be a problem with “blog_date” in your ru.yml file. I believe your file should include something like below. Correct indentation is important, but gets stripped out by Disqus here. Do you have a fork on github?

    blog_date: “%e %b %Y”

  • Stanislav A. Bourakov

    Thank you very much! It works!

    Do you plan to adapt to Spree version 2.1?

  • Hi. Yes, I’ll update it soon. There are a few forks on github, so I’ll see if I can pull any of their changes in first.

  • Stanislav A. Bourakov

    Thank you, I wish you successful work and other successes!

  • Ekaterina Belinskaia

    Hello! I also interested in the development of this plugin on rails 4, is this a really difficult job or you just do not have time to do it? Thanks.

  • Hi Ekaterina. I’m attempting to merge in some of the changes people have made in their forks and update for Rails 4, Spree 2.1 and 2.2. I’ll hopefully push the changes to Github in the next day, or so.

  • Ekaterina Belinskaia

    Thank you, Stefan, I’m waiting for testing! ;))

  • Ekaterina Belinskaia

    Hi! This week I’m testing a new branch 2.1, everything works great, thank you for your talent, Stefan!

  • Hi Ekaterina. Glad it is working for you. Thank you for testing!

  • Sumit Sharma

    Hi Stefan! I’ve tried to use your extension for spree 2-3-stale by making some changes in version of spree and rails, but I’m having some issues while clicking on “categories” and ‘tags” at front side.
    Are you working on provide support for spree 2-3-stable. Or I’ll do a fork and make changes?

  • Hi Sumit. I have not looked at updating it for Spree 2.3 yet. Please feel free to fork it and submit a pull request with your changes.

  • Sumit Sharma

    I’ve upgrade blog extension for support spree 2-3-stable , I’ve made a pull request for you.

This site uses cookies. Find out more about cookies.