Shopify news on www.shopify.info

Part of my work at jaded Pixel a few months ago was development and writing for a new “brochure” site at www.shopify.info. The current site, like the old one, is built with the fantastic Radiant CMS and uses a modified version of the rss_reader extension from BJ Clark, Loren Johnson, and Alessandro Preite Martinez.

We are using it to grab feeds that we publish in other places and re-display them to fit with the design of the site. For example our screenshots page is generated from our blog’s Shop of the Moment feed, and our list of supported methods for accepting payment is fed directly by Shopify itself.

Here is a modified version of the extension, available for your enjoyment and scrutiny:

rss_reader-0.2a-jadedpixelmod.tgz

Just unpack with tar xvzf rss_reader-0.2a-jadedpixelmod.tgz in your Radiant app’s root directory and it’ll put the necessary stuff in lib and vendor.

The modifications that I made add a few new features and, thanks to Tobi’s help, improved the robustness of the feed fetching code quite a bit. So for example, now you can order the feed however you want using a syntax similar to SQL’s ORDER BY:


<ul>

  <r:feed:items
      url="http://feeds.boingboing.net/boingboing/iBag" 
      order="creator ASC">

    <li><r:feed:link /></li>

  </r:feed:items>

</ul>

You can also do headers to mark off sections:


<ul>

  <r:feed:items
      url="http://feeds.boingboing.net/boingboing/iBag" 
      order="creator ASC">

    <r:feed:header for="creator">
      <h2><r:feed:creator /></h2>
    </r:feed:header>

    <li><r:feed:link /></li>

  </r:feed:items>

</ul>

This would show the code within the <r:feed:header /> tag if and only if the “creator” attribute of the item is different from the previous item in the list. Thus, it would only make reasonable output if the feed were ordered by creator with the above method. Another more obvious grouping for headers would be the item’s “date” attribute. Yes, the date of a feed item has hours and minutes and seconds, but I made it so that a new header only appears on new days of the month.

You can sort items and group headers by date, title, content, creator, or link (i.e. the URL of the item). There are a few other options for the feed tags that I haven’t mentioned here but which are documented within the code.

3 Responses to “Modified rss_reader Radiant extension”

  1. Brian Evinou Says:

    I wish I knew what this all meant. I feel like when the next generation comes along they’ll all look at me like Im the retard who doesnt know how to use the dvd player.

  2. Loren Johnson Says:

    Hey James,

    I just caught-up with your note on the Radiant mailing list re. your improvements to this extension. I’d be happy to merge them back as the official version of this extension at this point, adding your name to the authors. Drop me an email if you’ve made any additional updates since posting this tarball. Otherwise I’ll comment back here and/or email the Radiant list when I’ve checked it in.

    Cheers,

    Loren

  3. Loren Johnson Says:

    Ah. I see I’m way out of date and that the Wiki was already updated to point here for the extension which is good. If it’s of any help let me know if you’d like me to move this into my extension repository so it’ll be in svn (http://svn.fn-group.com), I personally think the tarball is fine.

    Cheers,

    Loren

Sorry, comments are closed for this article.