This is basically the same as https://www.drupal.org/project/ideas/issues/607396 (and related to the older https://www.drupal.org/project/ideas/issues/501366)
Problem/Motivation In most Drupal projects, the need comes up for a collection of fields. This is normally achieved with a light-weight entity such as Paragraphs or Field collection.
In Drupal 8 the go to solution for this is the Paragraphs module, which over time was also expanded to control content-type display, so that content editors could effectively control layouts with it.
Now Drupal core has a stable layout builder, the need to use it for layouts is no more, but there is still a need to use it for compound fields. This however doesn't integrate as well with layout builder, because there is a disconnect between content-editing and layout building.
In addition, in core we have a use case for such a compound field in the ingredients field on the Umami recipe content type. At present it is implemented as a text-field, which prevents us from using Drupal's modelling tools to build powerful features such as a view listing 'all recipes featuring chocolate'. This is because the ingredients field is used to list three distinct items. E.g.
1 cup of flour
When really this should be three fields
1 (quantity) cup (unit) of flour (ingredient)
If we had a way to build compound fields from the UI in core, we could construct a new field-type for the ingredients list comprising the following sub-fields
- Quantity - number
- Unit - text-list or taxonomy term
- Ingredient - taxonomy term
This would unlock Drupal's relationship modelling power.
Proposed resolution Add a compound field type to core with a proposed target of being an experimental module in Drupal 9.1
The field will provide a UI to allow site-builders to build new field-types by combining existing field types.
All other functionality should continue to work.
- Views support
- formatter support
- widget support
- data storage and retrieval
- serializer support (JSON API etc)
- translation support
- revision support
Remaining tasks Work has commenced in both the Field union (PreviousNext) and rich field (Lullabot) projects to investigate how feasible this is.
The two have agreed to join-forces and work towards a common goal
We have a slack channel #multifield
Recent comments
I think this alternative works too. Instead of installing the stub modules, you may be able to just insert the relevant records in the systems table (while also ensuring entity_plus and...
Entity_plus_custom with search api
This relates to a problem with creating a View of Projects on a site using MySQL >= 8.0.3 https://github.com/backdrop/backdrop-issues/issues/5795 I can't be at the meeting this...
Dec 5th Weekly Dev Meeting
Additionally, "outside" means a file that is located outside a module folder. The second parameter of module_load_include() is the name of a module, so, this function assumes that you are loading a...
How to include other files in module?