如何在没有 APP 的情况下在 Shopify 中制作产品描述标签? [英] How to make product description tabs in Shopify with out APP?
问题描述
需要帮助在没有 APP 的情况下在 Shopify 中制作产品描述选项卡.只是使用标题标签,即 H4 和 h5.
我不想在描述区使用html代码.
感谢大家的帮助.但我已经创建了一个合适的解决方案,希望它会有所帮助.
在 {% section 'product-template' %} 文件中找到以下代码:
{{ product.description }}
替换为:
{%-assign product_description_content = product.description -%}{%-if section.settings.enable_description_tabs -%}{%- 分配 product_description_content = product_description_content |拆分:'<h6>'|第一的 -%}{%- 万一 -%}{% if product_description_content != '' %}<div id="product-description">{{ 产品描述 }}
{% 万一 %}{%-if section.settings.enable_description_tabs 和 product_description_content == '' -%}<div id="product-description">{% 包括产品标签"%}
{% 万一 %}
- 在架构中将以下对象附加到设置数组中(以启用/禁用选项卡):
{"type": "checkbox", "id": "enable_description_tabs", "label": "Enable Description Tabs", "default": true, "info":标题6标题将转换为标签标题,标签内容将是标题6标题之间的所有内容."}
- 创建一个名为product-tabs"的代码段,并将以下代码放入其中:product-tabs.liquid
现在在 Shopify 产品描述中为标题指定 h6,并在下一行放置内容.
我希望这对其他人也有帮助.
Need help to make product description tabs in Shopify with out APP. Just to using heading tags i.e. H4 and h5.
I don't want to use html code in description area.
Thanks for all for your help. But i have created a proper solution i hope it will help.
In the {% section 'product-template' %} file find the following code:
{{ product.description }}
Replace it with:
{%- assign product_description_content = product.description -%}
{%-if section.settings.enable_description_tabs -%}
{%- assign product_description_content = product_description_content | split: '<h6>' | first -%}
{%- endif -%}
{% if product_description_content != '' %}
<div id="product-description">
{{ product.description }}
</div>
{% endif %}
{%-if section.settings.enable_description_tabs and product_description_content == '' -%}
<div id="product-description">
{% include 'product-tabs' %}
</div>
{% endif %}
- In schema append the following object in the settings array (to Enable/Disable the tabs):
{"type": "checkbox", "id": "enable_description_tabs", "label": "Enable Description Tabs", "default": true, "info": "Heading 6 titles will be converted to tab headings, tab content will be everything between the Heading 6 titles." }
- Create a snippet named it 'product-tabs' and put the following code in it: product-tabs.liquid
Now in Shopify product description assign h6 for the heading and on the next line put the content.
I Hope this will also be helpful for other.
这篇关于如何在没有 APP 的情况下在 Shopify 中制作产品描述标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!