The integration with the Entity Browser is great for cases where there is a large amount of possible content to be embedded, and the challenging for the end-user is to find the right content. For cases where re-using content is sometimes useful but most assets are uploaded to be embedded only once, it would be great to be able to build on top of the widget provided by Inline Entity Form.
This would allow content authors to:
- click on a button, which opens a modal
- choose between creating a new entity or choose an existing one
- when creating a new entity, create it within the modal window
- save and embed
It would be great to achieve this via field widgets re-use. That sounds like a hard problem and that's why I suggest to create direct integration first and switch to file widgets re-use when we solve that.
Proposed resolution
Provide direct integration with EB.
Remaining tasks
PR from #10 needs some more work:
- clean-up (see comments on pull request)
- Automatically submit select step after EB has propagated it's selection
- Handle removal and new selection: currently selected entity is not displayed on the first step ATM. Instead of that we display entity browser. We need to display currently selected entity somehow and hide entity browser. If user wants to replace the entity we need to allow removal, which then triggers display of entity browser again
User interface changes
This two screenshots use entity browser that is provided by file_browser:
Files can be uploaded using DropzoneJS Entity browser widget or
selected from a view of existing images.
Comment | File | Size | Author |
---|---|---|---|
#19 | ee_eb_listing.png | 1.37 MB | slashrsm |
#19 | ee_eb_dropzone.png | 266.14 KB | slashrsm |
Comments
Comment #1
slashrsm CreditAttribution: slashrsm at Examiner.com commentedThere is already basic IEF integration for Entity browser, which could be used once we integrate EB with entity_embed.
Providing support for field widgets in general is also something we already discussed in the past (and decided to implement it at some point).
Comment #2
Dave ReidThis is the workflow that will happen when we can integrate with the Entity Browser module for selection. Seeing as we don't have an existing issue for that task, I'm repurposing this one for that.
Comment #3
Dave ReidI think we have a plan to make this possible with #2580703: [PP-1] Allow choice of entity reference field widget to be used for selection that doesn't require Entity Browser to be ready. Like re-using field formatters, let's make it possible to re-use any single field widget for selection in the Entity Embed modal.
Comment #4
slashrsm CreditAttribution: slashrsm at Examiner.com commentedI am working on this.
Comment #5
slashrsm CreditAttribution: slashrsm at Examiner.com commentedComment #6
Dave Reid@slashrsm: With the new direction in #2580703: [PP-1] Allow choice of entity reference field widget to be used for selection we shouldn't need explicit integration at all. As long as Entity Browser is available as a Field Widget, it will "just work."
Comment #7
slashrsm CreditAttribution: slashrsm at Examiner.com commentedHas there been any work done on #2580703: [PP-1] Allow choice of entity reference field widget to be used for selection yet? Field widgets have a lot of dependencies on fields, parent entity, ... I am not saying it is impossible to do it, but it will require a lot of funky hacking IMO. Taking that into consideration it seems like something that could take a lot of time to implement.
EB integration, on the other hand, is something that can be done in a day. I already have working code, it just needs some clean-up.
With D8 around the corner and people asking for solutions we need to be pragmatic. Our priority must be delivering features now even if they are not the best possible. Take #2613520: Best approach while media entity is being developed ? for example:
Preventing D7 situation should be our main priority right now. We need to roll recommended releases of main modules by the end of this year and in order to achieve that we need to be pragmatic.
I will continue working on this. When #2580703: [PP-1] Allow choice of entity reference field widget to be used for selection gets in I'll be happy to remove/deprecate it.
Comment #8
Dave ReidWe've already handled a lot of that heavy work with using formatters, we should be able to re-use the same to make field widgets work.
Comment #9
slashrsm CreditAttribution: slashrsm at Examiner.com commentedWidgets are much more complex than formatters IMO. Formatters generate some HTML and that's it. With widgets, however, you need to handle all funky things that field widgets do in their forms. I'd really like to see proof of concept that would be able to handle something as complex as IEF.
Comment #10
slashrsm CreditAttribution: slashrsm at Examiner.com commentedThis is still work in progress, but basic functionality is there. Still need to be done:
- clean-up
- Handle removal and new selection
- Automatically submit select step after EB has propagated it's selection
https://github.com/drupal-media/entity_embed/pull/190
Comment #11
slashrsm CreditAttribution: slashrsm as a volunteer commentedUpdated issue summary and explained what needs to be done.
Comment #12
slashrsm CreditAttribution: slashrsm at MD Systems GmbH commentedNew PR by @webflo.
https://github.com/drupal-media/entity_embed/pull/192
Comment #13
slashrsm CreditAttribution: slashrsm at MD Systems GmbH commentedComment #14
slashrsm CreditAttribution: slashrsm at MD Systems GmbH commentedFew comments on pull.
Comment #15
slashrsm CreditAttribution: slashrsm at MD Systems GmbH commentedMerged: https://github.com/drupal-media/entity_embed/commit/c86ffe140fb91bbf3ad5...
Thanks!
Comment #16
slashrsm CreditAttribution: slashrsm at MD Systems GmbH commentedComment #18
Wim LeersCan you post a screenshot in the future? Makes it easier for those following along to see what this actually looks like :)
Comment #19
slashrsm CreditAttribution: slashrsm at MD Systems GmbH commentedSure. Sprint was so intensive we forgot about this.