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 flourWhen 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've added a new recipe. The recipe has no PHP code. It has two module dependencies (one of those depends on another contrib module and both depend on core modules that are normally enabled)...
The Future of Configuration Recipes for Backdrop CMS
well @herb I cannot believe it, but the webform module was there in modules on the disc, but missing in the listed modules, so I delete the module folder, and downloaded it again. Then...
My Webform Worksheets have disappeared
The only thing I can think of is to make sure Webform module is enabled and that the content type that needs to contain the webforms has Webform enabled for it. Edit the content type and make...
My Webform Worksheets have disappeared