Closed (fixed)
Project:
Menu item content fields
Version:
8.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
24 May 2019 at 08:26 UTC
Updated:
18 Mar 2025 at 21:44 UTC
Jump to comment: Most recent
Comments
Comment #2
rodrigoaguileraSince menu items can be moved between menus is complicated to change the bundle of an entity for this case. For example nodes can't change the content type.
If bundles is a useful feature to add to this module I think is better to separate it from the parent menu of an item since I feel is very useful to move items from one menu to another and it can get pretty confusing for the user to lose the content of the fields when that happens.
If different set of fields are needed for different menu items this module is not ready yet.
You can keep this issue open if you have a plan to work on implementing bundles.
Comment #3
rodrigoaguileraI hope that was enough information
Comment #4
joshua.boltz commentedThis module looked like a promising alternative to Menu Item Extras:
https://www.drupal.org/project/menu_item_extras
But the turn off with this module is that you need to add fields across all menus, so if you need to add a single, simple Text field or Image field to just one of your menus for some special use case, it's also added to all the other menus. What if you wanted fields A and B added to one menu, and fields C and D added to another menu?
I feel like it should be fieldable per menu. I think that is the thing that Menu Item Extras does good, but that module is over worked with how it deals with and overrides theme functions and templates, which makes it a bit more cumbersome to work with.
Comment #5
rodrigoaguileraThe analysis from my first comment was mostly a from a data structure point of view.
A compatible solution for this module would be to use different form modes per menu so the ability to move menu items will be preserved but you get different forms for each type of menu. The view mode can already be set with the module as is.
Does this solution sound good?
I am open to include it in the module (probably storing the form mode for each menu in the third party settings of the menu entity).
Then the swap of the form mode can be done in a hook like the one introduced in Drupal 9.2
https://www.drupal.org/node/3189884
I think the feature can be simple to code but I won't code it myself as I don't have the need for it yet.
Comment #6
rodrigoaguileraBTW if bundles is the way to go I think the first step would be to expose the fieldability of menu items in Drupal core.
Please comment if you are interested: https://www.drupal.org/project/ideas/issues/3047131
Comment #7
justclint commented@rodrigoaguilera, I also prefer this method of using form modes. If Im understanding this module correctly, we could in theory, have actual Menu "types" vs menu_item_extras where every menu has to manage its own fields and new menus cant reuse a set of predefined fields.
Ive installed the base and ui module and created custom menu link form modes but I do not see how to assign the form modes to specific menus as you mentioned in https://www.drupal.org/project/menu_item_fields/issues/3056830#comment-1...
How exactly are you assigning the form mode to specific menu's?
Comment #8
rodrigoaguilera@justclint
I guess it depends on the use-case since having many "menu types" with different fields each can clutter the only bundle with fields that are not relevant, but it is great if you reuse fields form the different menu types.
The feature is not implemented yet so I updated the issue summary. I don't have the time to implement it now, but Merge requests are welcome
Comment #10
rodrigoaguileraForgot to close. Please open a new issue for the 2.0 version of the module if you want me to explain better how to use different form modes per-menu