shopify 中 settings_data.json 和 settings_schema.json 有什么区别
what is difference between settings_data.json and settings_schema.json in shopify
shopify 中的 settings_data.json 和 settings_schema.json 文件有什么区别,我可以通过两者设置主题设置,但我将在什么时候使用哪一个?我在下面给出了一个示例,其中显示了 Setting_schema.json 文件和 Setting_data.json 文件,但我可以理解两者都在管理部分创建相同的功能。但是那有什么区别呢。为什么 shopify 主题使用两种类型设置 json 文件?
/**Here is Setting_schema.json file :**/
[
{
"name": "theme_info",
"theme_name": "Minimal",
"theme_author": "Shopify",
"theme_version": "1.0",
"theme_documentation_url": "https:\/\/docs.shopify.com\/manual\/more\/official-shopify-themes\/minimal",
"theme_support_url": "https:\/\/support.shopify.com\/"
},
{
"name": "Layout",
"settings": [
{
"type": "checkbox",
"id": "enable_wide_layout",
"label": "Enable wide layout"
}
]
},
{
"name": "Colors",
"settings": [
{
"type": "header",
"content": "Background"
},
{
"type": "checkbox",
"id": "theme_bg_image",
"label": "Use theme background"
},
{
"type": "image_picker",
"id": "bg_custom",
"label": "Custom image"
},
{
"type": "radio",
"id": "bg_image_display",
"label": "Image display",
"options": [
{
"value": "tile",
"label": "Tile"
},
{
"value": "stretch",
"label": "Stretch"
}
]
},
{
像这样...
/**And Here is Schema_data.json code:**/
{
"current": {
"enable_wide_layout": false,
"theme_bg_image": false,
"bg_custom": "",
"bg_image_display": "tile",
"color_topbar_bg": "#eeeeee",
"color_body_bg": "#ffffff",
"color_footer_bg": "#eeeeee",
"color_borders": "#dddddd",
"color_primary": "#ab094b",
"color_button_primary_text": "#ffffff",
"color_secondary": "#767676",
"color_button_secondary_text": "#ffffff",
"color_topbar_text": "#a8003e",
"color_header_text": "#595556",
"color_body_text": "#5b5252",
"color_footer_text": "#555555",
"color_footer_social_link": "#555555",
"type_base_family": "'HelveticaNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif",
"type_base_size": "16px",
"type_header_family": "Google_PT+Serif_700_serif",
"type_header_size": "36px",
"type_accent_family": "Google_Lato_400_sans",
"type_accent_size": "16px",
"type_accent_transform": false,
"type_accent_spacing": false,
"favicon": "shopify:\/\/shop_images\/color_transparent_500px_81b18ab4-183c-480f-ba6a-529b0e9e665c.png",
"social_twitter_link": "",
"social_facebook_link": "",
"social_pinterest_link": "",
"social_google_plus_link": "",
"social_instagram_link": "",
"social_snapchat_link": "",
"social_tumblr_link": "",
"social_youtube_link": "",
"social_vimeo_link": "",
"social_fancy_link": "",
"social_rss_link": "",
"share_facebook": true,
"share_twitter": true,
"share_pinterest": true,
"social_sharing_style": "normal",
"checkout_header_image": "",
"checkout_logo_image": "shopify:\/\/shop_images\/color_transparent_500px_e0d779f9-b33c-47b1-bb14-fb8fde7411d7.png",
"checkout_logo_position": "left",
"checkout_logo_size": "medium",
"checkout_body_background_image": "",...........
以此为例
我可以在管理面板中看到两个输出主题设置选项那么它们之间有什么区别?
shopify 中的 settings_data.json 和 settings_schema.json 文件有什么区别,我可以通过两者设置主题设置,但我将在什么时候使用哪一个?我在下面给出了一个示例,其中显示了 Setting_schema.json 文件和 Setting_data.json 文件,但我可以理解两者都在管理部分创建相同的功能。但是那有什么区别呢。为什么 shopify 主题使用两个类型设置 json 文件?
此处的架构文件用于 generating/creating/editing 主题选项,这些选项将显示在用户的主题界面中。它是您用来创建选项(设置所有参数,如 ID、类型、标签等...)的工具。
数据文件正在记录所有选项值。它是 JSON 中的一种数据库。它可用于直接在主题中修改选项值或主题预设,而无需使用用户界面。
架构管理用户设置的键和数据存储值。
来自 Shopify post:link
settings_schema.json 对比 settings_data.json
settings_schema.json 文件控制主题编辑器中商家可用的组织和选项。它用于创建和编辑主题内可供商家使用的主题设置。主题设置遵循 Shopify 文档概述的指定文件格式。
settings_data.json 文件存储从主题编辑器保存的主题设置数据。它还可以包括“主题样式”,也称为预设。如果定义了预设,则它使商家能够选择由主题开发者预先确定的主题风格。然后主题样式为 settings_schema.json 文件中定义的键设置特定值。
shopify 中的 settings_data.json 和 settings_schema.json 文件有什么区别,我可以通过两者设置主题设置,但我将在什么时候使用哪一个?我在下面给出了一个示例,其中显示了 Setting_schema.json 文件和 Setting_data.json 文件,但我可以理解两者都在管理部分创建相同的功能。但是那有什么区别呢。为什么 shopify 主题使用两种类型设置 json 文件?
/**Here is Setting_schema.json file :**/
[
{
"name": "theme_info",
"theme_name": "Minimal",
"theme_author": "Shopify",
"theme_version": "1.0",
"theme_documentation_url": "https:\/\/docs.shopify.com\/manual\/more\/official-shopify-themes\/minimal",
"theme_support_url": "https:\/\/support.shopify.com\/"
},
{
"name": "Layout",
"settings": [
{
"type": "checkbox",
"id": "enable_wide_layout",
"label": "Enable wide layout"
}
]
},
{
"name": "Colors",
"settings": [
{
"type": "header",
"content": "Background"
},
{
"type": "checkbox",
"id": "theme_bg_image",
"label": "Use theme background"
},
{
"type": "image_picker",
"id": "bg_custom",
"label": "Custom image"
},
{
"type": "radio",
"id": "bg_image_display",
"label": "Image display",
"options": [
{
"value": "tile",
"label": "Tile"
},
{
"value": "stretch",
"label": "Stretch"
}
]
},
{
像这样...
/**And Here is Schema_data.json code:**/
{
"current": {
"enable_wide_layout": false,
"theme_bg_image": false,
"bg_custom": "",
"bg_image_display": "tile",
"color_topbar_bg": "#eeeeee",
"color_body_bg": "#ffffff",
"color_footer_bg": "#eeeeee",
"color_borders": "#dddddd",
"color_primary": "#ab094b",
"color_button_primary_text": "#ffffff",
"color_secondary": "#767676",
"color_button_secondary_text": "#ffffff",
"color_topbar_text": "#a8003e",
"color_header_text": "#595556",
"color_body_text": "#5b5252",
"color_footer_text": "#555555",
"color_footer_social_link": "#555555",
"type_base_family": "'HelveticaNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif",
"type_base_size": "16px",
"type_header_family": "Google_PT+Serif_700_serif",
"type_header_size": "36px",
"type_accent_family": "Google_Lato_400_sans",
"type_accent_size": "16px",
"type_accent_transform": false,
"type_accent_spacing": false,
"favicon": "shopify:\/\/shop_images\/color_transparent_500px_81b18ab4-183c-480f-ba6a-529b0e9e665c.png",
"social_twitter_link": "",
"social_facebook_link": "",
"social_pinterest_link": "",
"social_google_plus_link": "",
"social_instagram_link": "",
"social_snapchat_link": "",
"social_tumblr_link": "",
"social_youtube_link": "",
"social_vimeo_link": "",
"social_fancy_link": "",
"social_rss_link": "",
"share_facebook": true,
"share_twitter": true,
"share_pinterest": true,
"social_sharing_style": "normal",
"checkout_header_image": "",
"checkout_logo_image": "shopify:\/\/shop_images\/color_transparent_500px_e0d779f9-b33c-47b1-bb14-fb8fde7411d7.png",
"checkout_logo_position": "left",
"checkout_logo_size": "medium",
"checkout_body_background_image": "",...........
以此为例
我可以在管理面板中看到两个输出主题设置选项那么它们之间有什么区别?
shopify 中的 settings_data.json 和 settings_schema.json 文件有什么区别,我可以通过两者设置主题设置,但我将在什么时候使用哪一个?我在下面给出了一个示例,其中显示了 Setting_schema.json 文件和 Setting_data.json 文件,但我可以理解两者都在管理部分创建相同的功能。但是那有什么区别呢。为什么 shopify 主题使用两个类型设置 json 文件?
此处的架构文件用于 generating/creating/editing 主题选项,这些选项将显示在用户的主题界面中。它是您用来创建选项(设置所有参数,如 ID、类型、标签等...)的工具。
数据文件正在记录所有选项值。它是 JSON 中的一种数据库。它可用于直接在主题中修改选项值或主题预设,而无需使用用户界面。
架构管理用户设置的键和数据存储值。
来自 Shopify post:link
settings_schema.json 对比 settings_data.json
settings_schema.json 文件控制主题编辑器中商家可用的组织和选项。它用于创建和编辑主题内可供商家使用的主题设置。主题设置遵循 Shopify 文档概述的指定文件格式。
settings_data.json 文件存储从主题编辑器保存的主题设置数据。它还可以包括“主题样式”,也称为预设。如果定义了预设,则它使商家能够选择由主题开发者预先确定的主题风格。然后主题样式为 settings_schema.json 文件中定义的键设置特定值。