0

I've generated my menu based on the menu template from the stable theme

{% macro menu_links(items, attributes, menu_level) %}
  {% import _self as menus %}
  {% if items %}
    {% if menu_level == 0 %}
<ul{{ attributes }}>
  {% else %}
  <ul>
    {% endif %}
    {% for item in items %}
      <li{{ item.attributes.addClass('sidebar-item') }}>
        {{ link(item.title, item.url) }}
        {% if item.below %}
          {{ menus.menu_links(item.below, attributes, menu_level + 1) }}
        {% endif %}
      </li>
    {% endfor %}
  </ul>
  {% endif %}
  {% endmacro %}

First level are working fine, but the subitems are not showing, cause below is always empty.

I've already checked the number of items to show, it has no limit

enter image description here

enter image description here

This is my menu, with the subchild

enter image description here

I'm using drupal 9.3.2 and PHP8.0.8

2
  • 2
    You need to check “Expanded” next to the parent menu items (or arrange the same via code)
    – Clive
    Jan 11 at 11:21
  • Yes, that's it, thanks a lot ! Jan 11 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.