All things Shopify and commerce
In my header.liquid there is a menu in shema:
{
"type": "link_list",
"id": "menu",
"default": "main-menu",
"label": "t:sections.header.settings.menu.label"
},
And there is a mobile drawer menu:
{% render 'component-menu-drawer' %}
The problem is that I need to use a menu drawer outside of header.liquid in theme.liquid. How is it possible to take a menu from the header without adding it to global settings_schema.json. For example, as in the theme https://themes.shopify.com/themes/sleek/styles/glossy/preview . There, the drawer menu is located at the top level, along with the sections, and in the global menu settings there is no section under the menu, it is taken from what is in header.liquid. How is it possible to do the same?
To use the menu drawer from header.liquid in theme.liquid without modifying settings_schema.json, you can follow these steps:
Create a Global Menu Drawer Snippet:
Reference the Menu Drawer in theme.liquid:
Use Conditional Logic in Header (Optional):
Set menu as a Block Element (Optional):
By using a snippet for the drawer, you create a reusable component accessible from any template, keeping your settings organized and avoiding unnecessary edits to settings_schema.json.
Need seamless customer engagement on your site? Try the Debales AI Chatbot on Shopify for personalized support—let’s chat!
Please let us know if our reply is helpful by giving it a Like or marking it as a Solution!
As 2024 wraps up, the dropshipping landscape is already shifting towards 2025's trends....
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024