Shopify - host multiple themes at the same time
So, I'm selling some products on shopify. Let's say coffee.
I'm working with a new group that wants to sell my coffee, have a separate brand, have a branded website. Is there an easy way to do this with a single shopify account?
I added this to my page template
{% if page.title == "Cards Coffee" %}
{% layout "cardscoffee" %}
{% endif %}
And I could see how I could use this to create a sepa开发者_StackOverflowrately themed page. But his will only work if I'm linking directly to a sub page. I'm going to setup a separate DNS name for this new brand. Is there any way to get the requested url?
(page.url returns the main configured url, not what was actually requested).
Is there another approach I should be taking entirely (besides forking out an extra subscription?)
Couple of suggestions:
Use Javascript to grab the domain and add it as a CSS class on your element. Then add CSS rules dependent on that class that have the different branding.
If the new group already has a site you might consider giving them a plugin they can embed that uses the Shopify Javascript API to list products (the API now supports JSONP). If you go down this path, take a look at this article on the wiki that discusses how to remotely add to the cart.
Here is an alternative way of doing the same.
- Start by creating a new layout. Let's say it's called
cardscoffee.liquid
- Create a new alternative
page.liquid
. Let's call itpage.cardscoffee.liquid
- Make the new
page.liquid
just like the original one, except add{% layout 'cardscoffee' %}
to the top.
Now you will see that the Shopify Admin will give you a way of selecting which liquid file to use when you are editing a page.
精彩评论