'Add theme settings for configuration' 在 shopify 中 - 不断出现错误消息 'unexpected token'?
'Add theme settings for configuration' in shopify - Error message 'unexpected token' keeps coming up?
我正在按照 shopify 开发人员的说明为我的网站创建 'How did you hear about us form field'。仅供参考,我在 Mac 上使用 safari。一切正常,直到我进入配置中的 'Add theme settings for configuration.' 步骤。 settings_schema-json的目录,当前代码(下)已经存在:
[
{
"name": "theme_info",
"theme_name": "Themekit template theme",
"theme_version": "1.0.0",
"theme_author": "Shopify",
"theme_documentation_url": "https:\/\/github.com\/Shopify\/themekit",
"theme_support_url": "https:\/\/github.com\/Shopify\/themekit\/issues"
}
]
我正在尝试使用下面从 shopify 开发人员粘贴的代码添加到该代码中,有人告诉我将其粘贴到右大括号(上方)下方的新行中。但是每次我这样做并点击保存时,都会出现两条错误消息(请参阅 post 底部的附加屏幕截图)。消息显示为 'An error prevented settings_schema.json from being saved' 和 'Invalid JSON: unexpected token.' 有人知道这里出了什么问题吗?我将非常感激,因为我是编码的新手,这是我第一次尝试对我的网站进行任何更改!
谢谢科斯莫。
{
"name": "Hear About Us",
"settings": [
{
"type": "text",
"id": "hau_form_options",
"label": "Form options",
"default": "Facebook, Twitter, Google, Instagram, Youtube",
"info": "Separate each option with a comma"
},
{
"type": "header",
"content": "Form validation"
},
{
"type": "checkbox",
"id": "hau_form_validation",
"label": "Enable form validation",
"default": true
},
{
"type": "text",
"id": "hau_error_message",
"label": "Error message",
"info": "The error message that is displayed when no selection is made",
"default": "Please select an option below"
},
{
"type": "text",
"id": "hau_error_message_other",
"label": "Other field error message",
"info": "The error message that is displayed when there is no input in the 'Other' field",
"default": "Please fill the text field below"
},
{
"type": "header",
"content": "Error styling"
},
{
"type": "color",
"id": "hau_error_color",
"label": "Color",
"default": "#ff0000"
}
]
},
screenshot error message
缺少一个逗号 ,
,更正它并正常工作
更新:
我正在按照 shopify 开发人员的说明为我的网站创建 'How did you hear about us form field'。仅供参考,我在 Mac 上使用 safari。一切正常,直到我进入配置中的 'Add theme settings for configuration.' 步骤。 settings_schema-json的目录,当前代码(下)已经存在:
[
{
"name": "theme_info",
"theme_name": "Themekit template theme",
"theme_version": "1.0.0",
"theme_author": "Shopify",
"theme_documentation_url": "https:\/\/github.com\/Shopify\/themekit",
"theme_support_url": "https:\/\/github.com\/Shopify\/themekit\/issues"
}
]
我正在尝试使用下面从 shopify 开发人员粘贴的代码添加到该代码中,有人告诉我将其粘贴到右大括号(上方)下方的新行中。但是每次我这样做并点击保存时,都会出现两条错误消息(请参阅 post 底部的附加屏幕截图)。消息显示为 'An error prevented settings_schema.json from being saved' 和 'Invalid JSON: unexpected token.' 有人知道这里出了什么问题吗?我将非常感激,因为我是编码的新手,这是我第一次尝试对我的网站进行任何更改!
谢谢科斯莫。
{
"name": "Hear About Us",
"settings": [
{
"type": "text",
"id": "hau_form_options",
"label": "Form options",
"default": "Facebook, Twitter, Google, Instagram, Youtube",
"info": "Separate each option with a comma"
},
{
"type": "header",
"content": "Form validation"
},
{
"type": "checkbox",
"id": "hau_form_validation",
"label": "Enable form validation",
"default": true
},
{
"type": "text",
"id": "hau_error_message",
"label": "Error message",
"info": "The error message that is displayed when no selection is made",
"default": "Please select an option below"
},
{
"type": "text",
"id": "hau_error_message_other",
"label": "Other field error message",
"info": "The error message that is displayed when there is no input in the 'Other' field",
"default": "Please fill the text field below"
},
{
"type": "header",
"content": "Error styling"
},
{
"type": "color",
"id": "hau_error_color",
"label": "Color",
"default": "#ff0000"
}
]
},
screenshot error message
缺少一个逗号 ,
,更正它并正常工作
更新: