Categories

Новые шаблоны

Shopify. Как добавить элемент в мегаменю (на основе шаблона 58030+)

Alice Weasley Март 3, 2017
Rating: 5.0/5. From 1 vote.
Please wait...

Как правило, мегаменю содержит 6 элементов. Для того чтобы добавить ещё один элемент, следуйте таким инструкциям.

Shopify._How_to_add_item_to_megamenu_(based_on_58030+_templates)_1
  1. Откройте админ панель вашего сайта и перейдите на вкладку Интернет-магазин > Шаблоны > Редактировать HTML/CSS (Online Store > Themes > Edit HTML/CSS).

    Shopify._How_to_add_item_to_megamenu_(based_on_58030+_templates)_2
  2. Откройте файл settings_schema.json, расположенный в папке Config и сохраните копию.

    Добавьте этот код после кода последнего элемента мегаменю, который расположен в районе строки 1700, перед закрывающей ] для раздела меню. Так как элемент 6 больше не является последним элементом списка, нужно добавить запятую перед новым кодом.

    	  
    	  ,
          { 
    "type": "header", 
    "content": "Item 7" 
    }, 
    { 
    "type": "text", 
    "id": "mm7_name", 
    "label": "Item name", 
    "info": "Clear this field to disable Item #1" 
    }, 
    { 
    "type": "text", 
    "id": "mm7_link", 
    "label": "Item URL" 
    }, 
    { 
    "type": "text", 
    "id": "mm7_badge", 
    "label": "Item badge" 
    }, 
    { 
    "type": "paragraph", 
    "content": "———————————————————" 
    }, 
    { 
    "type": "checkbox", 
    "id": "mm7_sub_toggle", 
    "label": "Submenu" 
    }, 
    { 
    "type": "radio", 
    "id": "mm7_sub_content", 
    "options": [ 
    { 
    "value": "links_1", 
    "label": "1. Single menu (linklist)" 
    }, 
    { 
    "value": "links_4", 
    "label": "2. Block of menus (linklists)" 
    }, 
    { 
    "value": "products", 
    "label": "3. Products (collection)" 
    }, 
    { 
    "value": "blog", 
    "label": "4. Blog" 
    } 
    ] 
    }, 
    { 
    "type": "link_list", 
    "id": "mm7_sub_links_1", 
    "label": "1. Choose single menu (linklist)" 
    }, 
    { 
    "type": "link_list", 
    "id": "mm7_sub_links_4_1", 
    "label": "2. Choose Block of menus (linklists)" 
    }, 
    { 
    "type": "image", 
    "id": "img_list7_img_1.jpg", 
    "label": "Image file", 
    "max-width": 255, 
    "max-height": 167, 
    "info": "Maximum slide image dimensions are 255x167px" 
    }, 
    { 
    "type": "link_list", 
    "id": "mm7_sub_links_4_2" 
    }, 
    { 
    "type": "image", 
    "id": "img_list7_img_2.jpg", 
    "label": "Image file", 
    "max-width": 255, 
    "max-height": 167, 
    "info": "Maximum slide image dimensions are 255x167px" 
    }, 
    { 
    "type": "link_list", 
    "id": "mm7_sub_links_4_3" 
    }, 
    { 
    "type": "image", 
    "id": "img_list7_img_3.jpg", 
    "label": "Image file", 
    "max-width": 255, 
    "max-height": 167, 
    "info": "Maximum slide image dimensions are 255x167px" 
    }, 
    { 
    "type": "link_list", 
    "id": "mm7_sub_links_4_4" 
    }, 
    { 
    "type": "image", 
    "id": "img_list7_img_4.jpg", 
    "label": "Image file", 
    "max-width": 255, 
    "max-height": 167, 
    "info": "Maximum slide image dimensions are 255x167px" 
    }, 
    { 
    "type": "collection", 
    "id": "mm7_sub_products", 
    "label": "3. Choose products (collection)" 
    }, 
    { 
    "type": "blog", 
    "id": "mm7_sub_blog", 
    "label": "4. Choose blog" 
    }
    
    Shopify._How_to_add_item_to_megamenu_(based_on_58030+_templates)_3
  3. Сохраните изменения.

  4. В файле Snippets > widget-megamenu.liquid измените 6 на 7 в следующем коде в районе строки 10:

    {% for i in (1..6) %} 
  5. Сохраните изменения.

    Shopify._How_to_add_item_to_megamenu_(based_on_58030+_templates)_5
  6. В файле Локали > en.default.json (Locales > en.default.json) добавьте код нового элемента меню в районе строки 26:

  7. Сохраните изменения.

    Shopify._How_to_add_item_to_megamenu_(based_on_58030+_templates)_6
  8. Сохраните изменения и обновите сайт.

    Shopify._How_to_add_item_to_megamenu_(based_on_58030+_templates)_7

Ознакомьтесь с коллекцией высококлассных шаблонов Shopify.

Вы можете также ознакомиться с детальным видео-туториалом ниже:

Shopify. Как добавить элемент в мегаменю (на основе шаблона 58030+)
Шаблоны Shopify
Эта запись была размещена в Shopify туториалы и помечена как item, megamenu, menu, menu item, Shopify. Добавьте в закладки постоянную ссылку.

Submit a ticket

Если вы не смогли найти подходящее решение проблемы, пожалуйста воспользуйтесь следующей ссылкой, чтобы отправить запрос команде технической поддержки.
Отправить запросВы получите ответ в течение 24 часов