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"
}
]
},
{
Run Code Online (Sandbox Code Playgroud)
像这样...
/**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": "",...........
Run Code Online (Sandbox Code Playgroud)
像这样作为例子
我可以在管理面板中看到两个输出主题设置选项那么它们之间有什么区别?
shopify中的settings_data.json和settings_schema.json文件有什么区别,我可以通过两者设置主题设置,但我到底什么时候会使用哪一个?我在下面给出了一个示例,其中显示了Setting_schema.json 文件和Setting_data.json 文件,但我可以理解两者都在管理部分中创建相同的功能。但那有什么区别呢。为什么shopify主题使用两种类型的设置json文件?
架构文件用于为您的主题生成/创建/编辑选项,这些选项将显示在用户的主题界面中。您可以使用它来创建选项(设置所有参数,例如 ID、类型、标签等...)。
数据文件记录所有选项值。它是一种 JSON 格式的数据库。它可用于直接在主题中修改选项值或主题预设,而无需使用用户界面。
模式管理键并存储用户设置的值。
| 归档时间: |
|
| 查看次数: |
5335 次 |
| 最近记录: |