如何在没有 APP 的情况下在 Shopify 中制作产品描述标签? [英] How to make product description tabs in Shopify with out APP?

查看:82
本文介绍了如何在没有 APP 的情况下在 Shopify 中制作产品描述标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要帮助在没有 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,并在下一行放置内容.

将描述设为标题

为标题添加 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.

Make description as heading

Add h6 tag for heading

I Hope this will also be helpful for other.

这篇关于如何在没有 APP 的情况下在 Shopify 中制作产品描述标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
其他开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆