Make the maximum menu depth configurable

Created on 12 July 2014, over 10 years ago
Updated 6 February 2023, almost 2 years ago

Problem/Motivation

Once #2301239: MenuLinkNG part1 (no UI or conversions): plugins (static + MenuLinkContent) + MenuLinkManager + MenuTreeStorage β†’ is in, it would be possible to no longer hardcode the maximum depth of menus: MenuTreeStorage::MAX_DEPTH

Proposed resolution

  • Generate the schema using a configured maximum length
  • Try to not allow lowering the size

Remaining tasks

User interface changes

API changes

Postponed until

#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 β†’

πŸ“Œ Task
Status

Active

Version

10.1 ✨

Component
Menu systemΒ  β†’

Last updated about 23 hours ago

Created by

πŸ‡©πŸ‡ͺGermany dawehner

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • I am in need of this capabiltiy. Currently I am unable to add nodes to the menu in the desired location since it is not showing me all of the children. The options change from node to node depending upon the depth of the children for that node.

    For ex. one page node I try to add to the menu and I can see the full menu:

    Full menu

    Then I will access another node and try to add it to the menu and it only shows one level:

    Limited Menu

    We have a large site with lots of Academic content that is past the max depth of 9. Any recommendations on how to change the max depth would be much appreciated.

  • πŸ‡ΊπŸ‡ΈUnited States jnicola

    @jbaum_13 --> Not sure what combination of modules you are using, but we've got a lot of experience with crazy menus here at OHSU if you ever want to talk architecture that helps handle all of that!

    We've had plenty of mistakes to learn from and a decent amount of success that might work for you as well :) Feel free to reach out if you want.

    For a patch that someone asked for a while ago and I missed, here's what we wrote and are utilizing at OHSU as part of what we're up to. It's definitely not ready to be utilized into care as is and hasn't been tested beyond our very specific monolithic menu approach (which we're moving away from) so no guarantees this has any value at all, infact it may make things worse so implement at your own risk, haha.

  • @jnicola thank you so much for your quick response! I tried the patch as is and got the following error:

    SQLSTATE[42S22]: Column not found: 1054 Unknown column 'p10' in 'order clau
    se': SELECT "menu_tree".*
    FROM
    "menu_tree" "menu_tree"
    WHERE ("menu_name" = :db_condition_placeholder_0) AND ("depth" <= :db_condi
    tion_placeholder_1) AND ("enabled" = :db_condition_placeholder_2)
    ORDER BY "p1" ASC, "p2" ASC, "p3" ASC, "p4" ASC, "p5" ASC, "p6" ASC, "p7" A
    SC, "p8" ASC, "p9" ASC, "p10" ASC, "p11" ASC, "p12" ASC, "p13" ASC, "p14" A
    SC, "p15" ASC, "p16" ASC, "p17" ASC, "p18" ASC, "p19" ASC, "p20" ASC; Array
    (
    [:db_condition_placeholder_0] => main-menu
    [:db_condition_placeholder_1] => 1
    [:db_condition_placeholder_2] => 1
    )

    Thank you so much for your help! I greatly appreciate it!

Production build 0.71.5 2024