You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Shopify Liquid模板报错:excludedHandles值需为数组,如何解决?

解决Shopify主题自定义器中excludedHandles的数组格式错误问题

你遇到的错误是因为excludedHandles字段要求传入数组类型的值,但你当前传入的是逗号分隔的字符串。只需将格式修改为数组即可解决:

修改后的JSON代码:

"type": "section-builder-product-list",
      "settings": {
        "collection": "elixirs",
        "excludedHandles": [
          "minerals",
          "mineralien-banane",
          "wilde-krauter-pulver",
          "mineralien-passionsfrucht",
          "kurkuma-ritual",
          "matcha-ritual",
          "magnesium-complex"
        ]
      }
    },

说明

Shopify的product_list设置里,excludedHandles字段规定必须接收数组格式的数据,每个产品句柄作为数组的独立字符串元素。之前的字符串格式不满足类型校验,所以CLI抛出错误,调整为数组格式后就能通过校验。

内容的提问来源于stack exchange,提问作者Mathijs Delva

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.02 09:34:52