- 🇩🇪Germany Anybody Porta Westfalica
Added https://www.drupal.org/project/menu_item_extras → as alternative
Many thanks for the module, someone knows if there is a similar one but for Form modes (make each form mode fieldable)). ?
Currently, when you create custom menu items only the fields provided by core appear in the form with a fixed arrangment.
Since these links are a content entity they are technically fieldable but field_ui and the entity definition do not enable this possibility.
This proposal aims to add the code necessary to show the field UI interface and modify the menu theme template so it shows the rendered menu item content when available.
Since adding new view modes will be possible it also makes sense to be able to use them and the best place would be a view mode selector for the system menu block for choosing how the elements are going to be rendered.
This solution will be focused mainly on site builder needs so they can add fields, manage their display and the form for adding new links.
With this ability enabled in core we can deal with popular use cases like adding icons to menu items.
This will open the possibility to have more features around the menu system like different view modes to create what is known as 'megamenus' but this initial proposal will try to have minimal impact on how the menus work.
There is already a module that demonstrates the functionality:
Menu item content fields →
.
Another alternative approach is implemented by
https://www.drupal.org/project/menu_item_extras →
I found an issue that needs to be fixed so we don't add workarounds to the field UI module.
📌
Custom menu link entity type should not declare "bundle" entity key
Needs work
The initial suggestion to propose this as an idea comes from the following issue
✨
Introduce MenuLinkContent bundles
Closed: won't fix
.
In general there is some issues that propose bringing back bundles to menu entities(they existed at one point of the Drupal 8 development cycle) but I think first bringing fields and view modes will solve a lot of use cases like it does for the user entity and bundles can be considered in the future.
The most sensible place to place the tabs will be under /admin/structure/menu as tabs
Adding an image icon field to the entity
Sorting the form so the icon is the first thing we see (as it will appear first in the menu display)
We can configure the display of the icon
and then create some menu items with icon
Place the menu block
And then it will display like this (some CSS applied for the screenshot)
We can also add new view modes
Needs review
Idea
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Added https://www.drupal.org/project/menu_item_extras → as alternative
Many thanks for the module, someone knows if there is a similar one but for Form modes (make each form mode fieldable)). ?