Calling a linklist with a variable for a 4 level linklist

Topic summary

A developer is building a 4-level navigation hierarchy that exceeds Shopify’s default capabilities. Their approach:

Structure:

  • Primary linklist (list1) contains top-level categories
  • Each item in list1 has a matching handle that corresponds to a secondary linklist
  • Goal: Loop through list1, then dynamically call corresponding linklists using each link’s handle

The Problem:

  • The code works when the linklist handle is hardcoded
  • Fails when passing the handle as a variable (linklists[linklistHandle])
  • Developer confirmed the variable is being passed correctly and all related linklist handles are accurate

Proposed Solution:

  • Another user (justinmeyer) encountered similar indexing issues with the linklists object
  • Suggested workaround: Pass the handle through a downcase filter before using it
  • Example: {% assign listhandle = link.handle | downcase %}
  • This resolved the issue despite handles appearing correct, suggesting a potential Shopify bug with handle matching
Summarized with AI on November 9. AI used: claude-sonnet-4-5-20250929.

I am using linklists to display structured content on a page. I need an extra level of hierarchy than shopify navigation allows. So I have one linklist (list1) that is a single level deep and has all of the top level categories with an additional corresponding linklist for each item in list1. The handle for each corresponding linklist matches the link handle for each item in list1

I have been trying to write a loop that renders a link in list1 then uses the handle from that link to call the linklist that corresponds to it and render the appropriate links, children, and grandchildren.

The snippet i’m using to call the corresponding linklist works when hardcoded but doesn’t work when I try to pass it a variable. The handles for all the related linklist have been double checked and I’ve also confirmed that the variable handle is being passed to the snippet.

code on the page:

 <ul class="menu top-level">
      {% for link in linklists.list1.links %}
        <li class="menu-link">
        <a href="{{ link.url }}">{{ link.title }}</a>
        
        {% assign listhandle = link.handle %}
        {% include "linklist" with linklistHandle: listhandle %}
       </li>
     {% endfor %}
</ul>

code in a linklist snippet:

{% for link in linklists[linklistHandle].links %}
  - {{ link.title }}
      ...

bump

I ran into something similar where a handle I knew was correct wasn’t indexing properly into the linklists object. I think there is some sort of bug on shopify’s side because I worked around it by running my handle through the downcase filter. This should obviously do nothing but doing the equivalent of the following:

{% assign listhandle = link.handle | downcase %}:  

fixed the problem for me.