getgrav / grav-plugin-admin

Grav Admin Plugin
http://getgrav.org
MIT License
355 stars 223 forks source link

Feature: configure the editor related to pagemedia field. #2362

Open MiguelVis opened 12 months ago

MiguelVis commented 12 months ago

Currently the button + of the field / plugin pagemedia only works with an editor if it's named content (as in the default template).

The purpose of this button is to insert an image or file into the editor as a markdown link.

On the other hand, the drag & drop option works always.

This is because the editor name is hardcoded in the plugin code at themes/grav/app/pages/page/media.js, line 155:

let editor = Editor.editors.filter((index, editor) => $(editor).attr('name') === 'data[content]');

So as I understand there is no option to instruct the field / plugin to select another editor.

It could be very difficult to implement?

I will appreciate any help on this.

Thanks.