Display a collection on another site.

New Member
3 0 0

I would like to display a custom collection on another site, which is a rails application. I don't want to build a full on shopify application, we already have a shopify store set up and functioning how we'd like it, instead I would like to display a set of products on the home page of our rails app. What is the best way to do this?

0 Likes
Shopify Staff
Shopify Staff
5704 0 284

Create a collection called 'Off Site'. Add products to it.

Create an alternate version of your collection.liquid template called 'off-site'. Select that template for your Off Site collection on that collection admin page.

In the template, use:

 

{% layout none %}

 

Use an iframe to add your collection to your website.

And there are other ways.

Caroline from http://11heavens.com ∴ mllegeorgesand AT gmail DOT com
0 Likes
New Member
3 0 0

Thanks Caroline, I had not thought about using an iframe, I was hoping to use the API, but I'll give your way shot.

If anyone has advice on using the API for pulling a collection it would be much appreciated.

0 Likes
Shopify Staff
Shopify Staff
5704 0 284

Another way is to create a collection and use its feed.

You can use jQuery to parse an XML document.

On your collection admin page, grab the URL to the atom feed.

http://SHOPNAME.myshopify.com/collections/frontpage.atom

You can roll your own feed of course, using an alternate template and, this time, a special collection.

No need to use the API really.

Here's a pretty good tutorial on how to use jQuery to parse a feed, it's called

Easy XML Consumption using jQuery

http://www.webmonkey.com/tutorial/Easy_XML_Consumption_using_jQuery?oldid=20032

Caroline from http://11heavens.com ∴ mllegeorgesand AT gmail DOT com
0 Likes
Shopify Staff
Shopify Staff
5704 0 284

Yeah that text is big, I know.

Caroline from http://11heavens.com ∴ mllegeorgesand AT gmail DOT com
0 Likes
Shopify Staff (Retired)
Shopify Staff (Retired)
5711 0 122

I am impressed by the size of your text. And I am not easily impressed :)

http://shopifyplus.com ::: http://twitter.com/bacchus
0 Likes
Shopify Staff
Shopify Staff
5704 0 284

@Jamie

'Shut up and get on my horse'

Caroline from http://11heavens.com ∴ mllegeorgesand AT gmail DOT com
0 Likes
Shopify Partner
1179 1 62

I've used jQuery.load to accomplish a similar thing: http://fishdujour.typepad.com/blog/2009/05/integrating-sailwave-race-results-with-jquery.html

Take a look at our Apps: www.bookthatapp.com ♥ www.searchifyapp.com ♥ www.productsassistant.com
0 Likes
Shopify Staff
Shopify Staff
5704 0 284

on another site, which is a rails application

And of course, in your application, you can parse the feed and output the collection in your view, all server-side. It's better than updating the page with JavaScript. Search engines will be able to see your collection HTML. You can consume your feed using activeresource.

What I am trying to say here is that your collections are public and you can GET them without needing authentication, hence the API.

Caroline from http://11heavens.com ∴ mllegeorgesand AT gmail DOT com
0 Likes
New Member
3 0 0

Thanks for all the replies everyone. I ended up using a combination of Feedzirra and Hpricot to grab and parse the feed in a regular old ruby model. Next I'm going to add some caching so I don't have to hit up Shopify every time someone loads the page. Thanks again!

0 Likes