Problem
This request is a direct response to this issue that arose in UMN 2015 #2497361: [meta] Fix issues found during UMN Usability Testing 2015:
"Order of operations are backwards! For example, dependencies and prerequisites for structuring taxonomy/content/etc. are reverse from the way users conceptualize it. (e.g. creating terms before adding a field for terms) "
This quote is indicative of a "bottom up" pattern throughout Drupal. Once a structured content model has been created it should introspect it's own structure so that it's invisible to the end user. Drupal does not currently do this.
Proposed Solution
Add Inline Entity Form functionality to core (possibly but not necessarily the module, just the functionality)
Example
Inline entity form would enable site-builders to create experiences in which the user would not have to leave the content creation flow to create referenced sub-entities.
Where now a user on a music site might:
- create content of type "Album"
- save that content
- create content of type "Song"
- save that content
- create N other songs
- save those
- create content of type "Artist"
- Save that content
- edit song and add the artist
- repeat for each song
- edit the album and add all the songs
With inline entity form they would:
- Create an album
- In the same form create N songs and add the artist to each song
- save
Comments
Comment #2
tkoleary commentedComment #3
tkoleary commentedComment #11
colanI've got an idea that should do the trick, without dealing with all of widgets, modals and whatnot provided by the combination of Entity Browser and Inline Entity Form. (I'm ignoring the other option, Entity Connect, because it's not very popular. However, feel free to raise that as an option if it has a good design, etc.)
Given that core now provides the "Create referenced entities if they don't already exist" option when creating an entity reference field, which summarily creates the referenced entity (at least with the Autocomplete widget), why can't we simply redirect to the new entity edit form after saving the referencing form? The problem is that there's no opportunity to edit the reference during creation, but so what? It can be edited after the original form is saved.
To handle recursion, we can simply add entity forms to the queue. After each form is saved, the next one pops off the queue to be edited by a redirect when saving the previous form. Once all have been edited, we can finally redirect back to the original entity's page, which would happen normally.
This keeps things nice and simple, and doesn't introduce any accessibility problems with modals, etc.
We should probably add a checkbox in the field config to determine whether folks want to use this feature or not, which could exist alongside the "Create referenced entities if they don't already exist" checkbox. Directly below would probably make the most sense, but greyed out if the other one isn't checked:
If left unchecked, nothing would change from the current behaviour.
Thoughts?
Comment #12
colanMore generic title.
Comment #14
colanComment #15
colanComment #19
matsbla commentedMaybe we could have something similar as the widget provided by Media Library in core.