开发者

Shopify - host multiple themes at the same time

开发者 https://www.devze.com 2023-03-28 01:18 出处:网络
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 thi

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:

  1. 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.

  2. 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 it page.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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号