Shopify. 如何在大菜单中添加项目(基于58030+模板)
March 3, 2017
通常,超级菜单包含6个菜单项. 若要再添加一项,请执行以下更改.
-
打开站点管理面板并导航到 Online Store > Themes > Edit HTML/CSS.
Open settings_schema.json 文件位于 Config 文件夹并保存其副本.
在最后一个大菜单项目代码之后添加此代码, 大概在1700行左右, 在结束前的菜单部分. 由于item 6不再是列表中的最后一项,我们需要在新代码之前添加一个逗号.
, { "type": "header", “内容”:“第7项” }, { "type": "text", "id": "mm7_name", “label”:“物品名称”; "info": "清除此字段以禁用项目#1" }, { "type": "text", "id": "mm7_link", "label": "项目URL" }, { "type": "text", “id”:“mm7_badge”, "label": "项目标识" }, { “类型”:“段”, “内容 ": "———————————————————" }, { “类型”:“复选框”, “id”:“mm7_sub_toggle”, “标签”:“子菜单” }, { "type": "radio", “id”:“mm7_sub_content”, "options": [ { “价值”:“links_1”, "label": "1. 单菜单(链接列表)” }, { “价值”:“links_4”, "label": "2. 菜单块(链接列表)" }, { “价值”:“产品”, "label": "3. 产品(集合)” }, { "value": "blog", "label": "4. Blog" } ] }, { “类型”:“link_list”, “id”:“mm7_sub_links_1”, "label": "1. 选择单个菜单(链接列表)" }, { “类型”:“link_list”, “id”:“mm7_sub_links_4_1”, "label": "2. 选择菜单块(链接列表)" }, { "type": "image", “id”:“img_list7_img_1.jpg", "label": "图像文件"; "max-width": 255, “max-height”:167年, "info": "幻灯片图片最大尺寸为255x167px" }, { “类型”:“link_list”, “id”:“mm7_sub_links_4_2” }, { "type": "image", “id”:“img_list7_img_2.jpg", "label": "图像文件"; "max-width": 255, “max-height”:167年, "info": "幻灯片图片最大尺寸为255x167px" }, { “类型”:“link_list”, “id”:“mm7_sub_links_4_3” }, { "type": "image", “id”:“img_list7_img_3.jpg", "label": "图像文件"; "max-width": 255, “max-height”:167年, "info": "幻灯片图片最大尺寸为255x167px" }, { “类型”:“link_list”, “id”:“mm7_sub_links_4_4” }, { "type": "image", “id”:“img_list7_img_4.jpg", "label": "图像文件"; "max-width": 255, “max-height”:167年, "info": "幻灯片图片最大尺寸为255x167px" }, { “类型”:“集合”, “id”:“mm7_sub_products”, "label": "3. 选择产品(收藏)” }, { "type": "blog", “id”:“mm7_sub_blog”, "label": "4. Choose blog" }
Save the changes.
-
In the Snippets > widget-megamenu.liquid 在第10行左右的代码中将文件更改6到7:
{% for i in (1..6) %}
Save the changes.
-
In the Locales > en.default.json 在第26行周围添加新菜单项的代码:
Save the changes.
Save 更改并刷新站点.
看一看精选的顶级产品 Shopify themes.
请随时查看下面的详细视频教程:
Shopify. 如何在大菜单中添加项目(基于58030+模板)