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
相关产品推荐
相关产品推荐

