Shopify - 同时托管多个主题
所以,我在 Shopify 上销售一些产品。就说咖啡吧。
我正在与一个新的团队合作,他们想销售我的咖啡,拥有一个独立的品牌,拥有一个品牌网站。有没有一种简单的方法可以使用单个 Shopify 帐户来做到这一点?
我将其添加到我的页面模板中
{% if page.title == "Cards Coffee" %}
{% layout "cardscoffee" %}
{% endif %}
,我可以看到如何使用它来创建单独的主题页面。但只有当我直接链接到子页面时,他的方法才会起作用。我将为这个新品牌设置一个单独的 DNS 名称。有什么办法可以获取请求的url吗?
(page.url 返回主要配置的 url,而不是实际请求的 url)。
我是否应该完全采取另一种方法(除了支付额外的订阅之外?)
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 separately 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?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
几个建议:
使用 Javascript 获取域并将其作为 CSS 类添加到您的元素上。然后添加依赖于具有不同品牌的类的 CSS 规则。
如果新群组已经有一个网站,您可以考虑为他们提供一个可以嵌入的插件,该插件使用 Shopify Javascript API 列出产品(API 现在支持 JSONP)。如果您沿着这条路走下去,请查看 wiki 上的这篇文章,其中讨论了如何远程添加到购物车。
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.
这是执行相同操作的另一种方法。
cardscoffee.liquid
page.liquid
。我们将其命名为page.cardscoffee.liquid
page.liquid
就像原来的一样,除了添加{%layout 'cardscoffee' %}
> 到顶部。现在您将看到 Shopify 管理员将为您提供一种在编辑页面时选择要使用的液体文件的方法。
Here is an alternative way of doing the same.
cardscoffee.liquid
page.liquid
. Let's call itpage.cardscoffee.liquid
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.