Not sure if this has already been raised - issue search bombed out every time - I imagine it could be a duplicate as it is rather basic.
Issue:
Children of top level Main Menu items appear correctly in the hierarchy displayed in the Structure >> Menus >> Main Navigation >> List Links but do not get printed in the html generated for the Main Menu.
Expected behaviour:
As Drupal 7. Child menus are printed as second level submenus of top-level main menu. (See Drupal 7.png)
Actual behaviour:
Only the top level main menu items' html are printed even though List Links shows them correctly. (See Drupal 8.png)
Steps to reproduce:
- Create a Basic Page with Main Menu Item "First Basic Page"
- Create another Basic Page with Menu item whose parent is First Basic Page
- Look at Structure >> Menus >> Main Navigation >> List Links
- Look at generated html with Stark theme
M
Note:
Although a manually-created menu can create the hierarchy of li
's correctly (where the Main menu does not), it should be noted that even the manually-created menu top-level cannot seemingly be set "expanded" as in Drupal 7, thus the submenus' html is not printed until the parent li/ a is clicked.
Comment | File | Size | Author |
---|---|---|---|
#12 | step6_visit_front_page.PNG | 30.67 KB | hitetlen |
#12 | step5_show_as_expanded.PNG | 37.83 KB | hitetlen |
#11 | step4_node1_page.PNG | 41.5 KB | hitetlen |
#11 | step3_front_page.PNG | 44.01 KB | hitetlen |
#11 | step2_configure_main_nav_block.PNG | 38.9 KB | hitetlen |
Comments
Comment #1
iainH CreditAttribution: iainH commentedComment #2
iainH CreditAttribution: iainH commentedComment #3
iainH CreditAttribution: iainH commentedI see that https://www.drupal.org/node/2256521 is going to change everything! I'll leave this issue open, though as It will be useful to track the keenly anticipated and refactored menu system and hopefully I can document how to use it to achieve this simple task.
Comment #4
yoroy CreditAttribution: yoroy commentedCould you check if the problem reported here still exists now that #2256521: [META] New plan, Phase 2: Implement menu links as plugins, including static admin links and views, and custom links with menu_link_content entity, all managed via menu_ui module got in? Thank!
Comment #5
dawehner.
Comment #6
stevesmename CreditAttribution: stevesmename commentedThis is resolved by configuring the block settings of "Main navigation" or any other menu settings for the Block Plugin. The default setting for "Maximum number of menu levels to display" is set to "1". Change this setting to "Unlimited" to see children displayed.
Tagging this issue with possible "needs documentation", otherwise it's considered Fixed.
Comment #7
stevesmename CreditAttribution: stevesmename commentedComment #8
stevesmename CreditAttribution: stevesmename commentedAll I think is required is finding where the documentation is to override the default configuration for 'depth' in SystemMenuBlock. Best link found is below but maybe someone else has a better link for documentation purposes.
https://api.drupal.org/api/drupal/core!modules!system!src!Plugin!Block!S...
Comment #9
stevesmename CreditAttribution: stevesmename commentedComment #10
mtiftComment #11
hitetlen CreditAttribution: hitetlen commentedThis bug is still not fixed. That is true, that I can set maximum number of menu levels to display in main nav block settings, but child menu links are only visible, when I click on the parent menu link.
Update:
Okay, I finally found the solution. On main menu settings page, it needs to be checked the "Show as expanded" checkbox.
Comment #12
hitetlen CreditAttribution: hitetlen commentedComment #13
chadmandoo CreditAttribution: chadmandoo as a volunteer commentedStep #11 works as intended. This is not very obvious but I can confirm that you need to go to the links and check show as expanded.
Comment #24
cilefen CreditAttribution: cilefen commentedI am closing this support request because there have been no recent comments.
The Drupal Core issue queue is not the ideal place for support requests. Consider other sources of support.
If documentation is in fact needed open a documentation task issue.