Closed rhino-corey closed 3 years ago
Hi,
I never tried Whitecube Flexible Content repeater and I don't know how it works, but from your description I can just suggest try using some temporary variable for ID, something like this:
$i = 1;
NovaTinymce5Editor::make('Body')->id('body_' . $i)->withMeta(['mediaLibrary' => true]),
MediaLibrary::make('Insert image', 'js_callback_media_library')
->jsCallback('mediaLibrarySelectFiles', ['editor' => 'body' . $i])->types(['Image']),
$i++;
Hope this helps.
I see what your saying, but those controls are only registered once within PHP. The repeating rows are then added via javascript.
It's a pretty useful Nova control if you haven't tried it yet: https://whitecube.github.io/nova-flexible-content/
Perhaps the integration would need to be baked into the repeating control. It's going to require more research to figure this out.
I'm using the editor within the Whitecube Flexible Content repeater to create rows of content, which works fine. When I add the NovaMediaLibrary, the callback has no idea which editor to place the image into.
I can get it to work in the first repeater row if I set the editor ID, but none of the other repeated rows will work then.
Any idea how the editor can be adapted to get media selection working when the editor is nested within a repeater?