根据页面分配不同的 class 到 shopify-section
Assign a different class to shopify-section depending on page
在我网站的博客部分中,我指定要添加到我的模式代码中的 shopify-section
上的 class。这是该代码的快照(我不会 post 全部):
{% schema %}
{
"name": "Blog",
"class": "band band--tint",
"settings": [
效果很好,但是在我的 product.liquid
中,布局略有不同,我不希望该页面上有 band--tint
class。
有没有一种方法可以定位 handle/template,以便我可以仅针对该布局删除此 class?
您可以创建一个备用模板来修改 HTML。
Creating an alternate template allows you to modify the way content is
shown on your online store, but only for the products, collections,
blogs, and other pages that you apply the alternate template to. For
example, you can create an alternate product template that has no add
to cart button, and apply it only to products that are not for sale.
Or, you can create an alternate page template that doesn’t include a
header, and apply it to a selection of your store’s pages.
在我网站的博客部分中,我指定要添加到我的模式代码中的 shopify-section
上的 class。这是该代码的快照(我不会 post 全部):
{% schema %}
{
"name": "Blog",
"class": "band band--tint",
"settings": [
效果很好,但是在我的 product.liquid
中,布局略有不同,我不希望该页面上有 band--tint
class。
有没有一种方法可以定位 handle/template,以便我可以仅针对该布局删除此 class?
您可以创建一个备用模板来修改 HTML。
Creating an alternate template allows you to modify the way content is shown on your online store, but only for the products, collections, blogs, and other pages that you apply the alternate template to. For example, you can create an alternate product template that has no add to cart button, and apply it only to products that are not for sale. Or, you can create an alternate page template that doesn’t include a header, and apply it to a selection of your store’s pages.