How to add plain text under specific menu item in Drawer Menu

Hello,

How can i add extra line of text to separate each group in Drawer Menu as shown below?

Hi @StudioBlank ,

Please see the solution below:

To add text under a specific menu item in a Shopify Drawer Menu, you can edit the theme’s code.

Step 1:

Create separate sub-menus for “TOPS,” “BOTTOMS,” and “MISC” under Online Store > Navigation.

Step 2:

Locate the file where the drawer menu is defined, such as header.liquid, drawer.liquid, or a specific snippet like menu-drawer.liquid.

Update the code as below:


    {% assign tops_menu = linklists['tops-menu'] %}
    {% assign bottoms_menu = linklists['bottoms-menu'] %}
    {% assign misc_menu = linklists['misc-menu'] %}

    
    {% if tops_menu.links.size > 0 %}
      - TOPS

      {% for link in tops_menu.links %}
        - {{ link.title }}

      {% endfor %}
    {% endif %}

    
    {% if bottoms_menu.links.size > 0 %}
      - BOTTOMS

      {% for link in bottoms_menu.links %}
        - {{ link.title }}

      {% endfor %}
    {% endif %}

    
    {% if misc_menu.links.size > 0 %}
      - MISC

      {% for link in misc_menu.links %}
        - {{ link.title }}
      {% endfor %}
    {% endif %}

Step3:

Locate theme.css or theme.scss.liquid or styles.css or style.scss.liquid

Add the below css code:

.drawer-menu-header { 
font-size: 14px;
font-weight: bold; 
margin-top: 15px; 
margin-bottom: 5px; 
color: #333; 
}

If you need further assistance, feel free to reach out!
I hope this helps! If it does, please like it and mark it as a solution!

Regards,

Sweans

This just made sub-menus.

I just want unclickable, plain text above the menu link

I just found the solution.

You just need to add this code under {%- for link in section.settings.menu.links -%} in header-drawer.liquid.

{% if link.title == "Insert Collection Title here" %}
   
   

Insert Text Here

 

{% endif %}

And to customize the text, you need to add this code anywhere in component-menu-drawer.css, preferably under .menu-drawer__menu-item

.drawer-text {
  font-family: "Insert Font Here";
  font-size: 12px;
  color: #000000;
}

But thank you for your advice.