It would be really amazing if we could integrate this with a system much like inline entity form. Any thoughts on this?
| Comment | File | Size | Author |
|---|---|---|---|
| #27 | 2679875-27.patch | 14.67 KB | rajab natshah |
| #20 | 2679875-20.patch | 16.58 KB | rajab natshah |
| #17 | entity_embed-inline_entity_form_integration-2679875-17.patch | 15.75 KB | ieyara |
Comments
Comment #2
mattgross commentedI second this request. This feature would be fantastic.
For example, I need to create some embeddable galleries for a client & it would be amazing if they could create said galleries from right on the page they were editing.
Comment #3
eveyrat commented+1
Comment #4
khaled.zaidan commentedYeah, agreed, this would be awesome.
Having that would give the potential of getting rid of so many fields and just having everything inside the WYSIWYG!
Has there been any progress on this? I might be able to put in sometime on this feature for the D8 version (especially if I manage to sell the idea to management at work).
Any update would be helpful :)
Comment #5
mattgross commentedIt looks like there's been zero progress so far unfortunately. If you have the time & could pitch it go for it! :)
Comment #6
marcoscanoThis is already possible if you use Entity Browser, which has a built-in integration with IEF. Have you tried that option?
Comment #7
arrowI took crack at this for 8.x. This patch adds a checkbox for enabling Inline Entity Form support for your embed button. Ticking the box turns the bundle selection field into a single value select field and is used to define the bundle that is used to create a new entity. It disables entity browser selection as this essentially modifies the default entity reference field.
Comment #9
wim leersExactly!
The project page even mentions this:
Comment #10
rajab natshahAn update for the patch to work with latest version
As Entity Browser will have 3 or 2 and one more confirmation steps buttons.
A direct entity embed with a form mode for selected media types will be faster to embed
Hope that we could switch to the new way with Media Library
#2994699: Create a CKEditor plugin to select and embed a media item from the Media Library
Comment #11
rajab natshahBetter patch
Comment #12
rajab natshahAn optimization round for the patch
Comment #13
rajab natshahComment #14
rajab natshahComment #15
devkinetic commentedThe patch from #13 did not integrate cleanly into my module, but I'm not sure if it's because I have a few other patches already or if the module itself has just changed too much. In either case, I rerolled the same code from the patch into my module and it ended up working great!
Our use case was that along with the media browser (using the Media Directories module), I wanted to setup dedicated "create media type" buttons, on the WYSIWYG as a shortcut. Using this patch, I was able to get that to work. The only thing I ran into is after the entity was created, in this case media, when I tried to edit the embed, it would open the same dialog. What I really wanted was for it to open with the media_directories, or media library dialog. I worked around this by using MYMODULE_entity_embed_values_alter() and just swapped out the
$values['attributes']['data-embed-button']value to be what I wanted it to be in an alter. If this gets any more traction we could add a new config value to allow writing that different value in the same manner to the token as I have done below:Anywho, this is a great feature, and while entity_browser can work, this is faster and more flexible out-of-the-box IMHO. For example, how would one use that module to create a button that allows you to upload PDFs into a "document" media type? Using this patch I can simply select that media type and check off the create checkbox. As far as I can tell, this is not possible with entity browser.
I reopened this because this solves a fundamental issue with media embedding. I want to create an item from a dialog from one module, and then later edit it with the features in another module. A best of both worlds approach. If I use the options available from entity_browser I am tied into their workflow. This ability allows us to create our own combinations.
Comment #16
devkinetic commentedI discovered a bug, wherein not all embed buttons use a browser, yet we check for a browser in:
\Drupal\entity_embed\Form\EntityEmbedDialog::submitSelectStepI changed it to the following:
Comment #17
ieyara commentedI created a new patch based on 2679875-13.patch that includes:
Comment #18
rajab natshahComment #19
rajab natshahComment #20
rajab natshahRe-rolled the patch from #17 to work with Entity Embed 8.x-1.4
Comment #22
rajab natshah--
Comment #23
rajab natshahMaybe a new logic is needed to cover both 4 and 5 at the same time.
Comment #24
rajab natshahComment #25
rajab natshahComment #26
rajab natshahComment #27
rajab natshahEntity Embed 8.x-1.5 on: 6 Nov 2023 by: Dave Reid
https://www.drupal.org/project/entity_embed/releases/8.x-1.5
Thanks, Dave
Re-rolled the patch from #20 to work with Entity Embed 8.x-1.5
Comment #28
loze commentedThis works fairly well in many cases, however when the IEF has a media browser field in it, when you click the button to open the media browser the entity embed IEF modal is replaced with the media browser, and clicking the insert media button closes the whole modal so nothing is ever added.
Clicking a media browser button (or any form element that opens a modal) should spawn a new modal on top. I'm not sure if this is something to address here or with the media module.
#2741877: Nested modals don't work: opening a modal from a modal closes the original