Allow pages to have menu items

Created on 20 November 2015, about 9 years ago
Updated 24 October 2023, about 1 year ago

In Page Manager in Drupal 7, you can make your page into a menu item - similar functionality should exist for Drupal 8!

The biggest difference is that in Drupal 7, this was just changing some of the values returned from hook_menu() since page callbacks and menu items were conflated. In Drupal 8, they are completely decoupled, which means we can actually create multiple different types of menu entries for the same page!

So, in Drupal 8, we should support declaring multiple different menu items of different types (including action links, etc) at the storage level. For the purposes of this patch, it's OK if the UI only allows creating a single menu item - we can figure out the UI later, but we don't want to have to deal with changing the config schema later.

✨ Feature request
Status

Needs work

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States dsnopek USA

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.

  • πŸ‡ΈπŸ‡ͺSweden kevineinarsson

    Changed some code from #25 since it broke my normal menu links, the derivative manager was only adding default_menu_tab and menu_tab items to the array of derivatives, as well as some inconsistent usage of the keys "menu" and "menu_name" causing some further issues.

    I've also used core's menu link overrides to move some menu links around. With #25, none were applied. When I tried to update some values, the call to updateMenuLink caused a WSOD due to it trying to set the values directly to on page entity (i.e. $page->weight->value) which obviously doesn't exist. Should these overrides even be written directly to the page entity? Why not do what core does where menu link overrides are saved in a separate config entry? makes more sense IMO.

  • ivnish Kazakhstan

    Patch #27 work, but I can't select menu item 2 level for my page. Only menu 1 level

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

    Rolled patch from #27 that is compatible with 4.0.0-rc2.

  • πŸ‡¨πŸ‡¦Canada jenniferaube

    Patch #29 fails

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update about 1 year ago
    Patch Failed to Apply
Production build 0.71.5 2024