SHopify Debut Theme Sidebar Dropdown Menu not Working

Hi,

I have a development site where weve done some good things, but I am stuck as to why the sidebar menu we created does not work. We are using the Shopify Debut theme & the documented “site-nav” snippet just as is done for the top navigation menu … which works!

You can see the pages here where there is a side menu that does not expand when clicked on & the top menu which does.

https://bsaverau.myshopify.com/pages/install-guide
https://bsaverau.myshopify.com/pages/faq

The pwd to access the store is 18260Wickham

The code to get the top menu in header.liquid is …

{% include 'site-nav', linklist: section.settings.main_linklist %}

… and the code Ive used for the side-menu is …

Installation {% include 'site-nav', linklist: 'sidebar-installation', wrapper_class: 'sidebar text-left' %} Other {% include 'site-nav', linklist: 'sidebar-other', wrapper_class: 'sidebar text-left' %}

… and FYI .. Ive tried removing the wrapper_class and that makes no difference.

And help woiuld be greatly appreciated!

Finally .. Ive checked the theme.js code and there is no errorneous comment code as per this post … https://community.shopify.com/c/Technical-Q-A/Debut-Drop-down-Menu-not-working/td-p/1006905

I created a solution which i thought i would post in case it helps someone else.

It is a side menu that works on the Debut Theme from Shopify and provides an expandable & collapsible multi level menu which highlights active items and expands sub-menus with active links. You can have multiple sub-menus and up to three levels.

  1. Create a snippet called sidenav

{% comment %}> Renders a list of menu items as vertical collapsable dropdown list> Accepts:> - linklist: {Object} Linklist Liquid object (required)> > Usage:> {% include ‘side-nav’, linklist: section.settings.main_linklist %}> {% endcomment %}> > {% for link in linklists[linklist].links %}> {% if link.links != blank %}> >
{% for child_link in link.links %}> {% if child_link.links != blank %}> >
{% for grandchild_link in child_link.links %}> - {{ grandchild_link.title }}> {% endfor %}> > {% else %}> - {{ child_link.title }}> {% endif %}> {% endfor %}> > {% else %}> - {{ link.title }}> {% endif %}> {% endfor %}>

  1. In your new page template for pages to use the side menu add the following script.
  1. Add CSS to theme.css or your own css file used in the template …

.active-link {display:block!important;}> /* Fixed sidenav, full height /> .sidenav {height: 100%;z-index: 1;top: 0;left: 0;overflow-x: hidden;}> / Style the sidenav links and the dropdown button /> .sidenav a, .dropdown-btn {cursor: pointer;white-space: nowrap;display: block;}> .sidenav .active a {text-decoration: underline;}> / On mouse-over */> .sidenav a:hover, .dropdown-btn:hover, .sidenav .active, .sidenav .active-link .active, .sidenav button.active-link {text-decoration: underline;}> .sidenav li {padding: 3px 10px;}> .sidenav .child {padding-left: 10px;}> .dropdown-container {display: none;}

  1. And finally, in your page template where you want the menu to appear … add the following replacing the “sidebar-menu-handle” with the handle of your menu.

{% include ‘side-nav’, linklist: ‘sidebar-menu-handle’ %}

There will no doubt be more styling, but this worked for me.

Hello,

I am looking at creating a side menu for the Debut theme, and I found your post. I have completed step one, but I can’t find “new page template” for step two.

Would you be able to help me find where it is? Also, are you able to post a link to your site so I can see what it looks like?

I am not a fan of how the top menu looks on a desktop. On a mobile device it has a menu button and looks great, that is what I am aiming for with the side navigation.

Any help would be great, thank you.

Hi,

You need to “create” a new page template. In “edit code” under “Templates” select “Add a new template”, select “page” and type Liquid & give it a name like “page.sidemenu.liquid”. then open “page.liquid” template & copy all the code into the new file. Then you have a “new” template.

And you can see it in action here …