Score:0

Front menu not showing subitems

cn flag

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

cn flag
You need to check “Expanded” next to the parent menu items (or arrange the same via code)
cn flag
Yes, that's it, thanks a lot !
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.