Follow-up to #2061377: [drupalImage] Optionally apply image style to images uploaded in CKEditor 5
Problem/Motivation
Inserting an image in the text editor dialog today requires the user to fiddle with image dimensions. Inserting a responsive image requires using awkward solutions like embedding an entity and setting a responsive image style in a view mode, and that allows for little flexibility in terms of alternative responsive image styles.
It's not great for the authoring experience nor for structured content reasons that users are defining the specific dimensions of every single image they insert. It'd be much better to allow them to choose from responsive image styles — just like we do for image fields.
Proposed resolution
Allow a responsive image style to be selected in the image dialog, which gets stored in a data-responsiveimagestyle attribute, and is handled by a responsiveimagestyle filter.
Remaining tasks
- Port code from #2061377: This allows selection of a responsive image style in dialog, inserting that sets a data- attribute, and a filter transforms the end result.
- Potentially move responsive image style preview to a separate issue, as is being in doing with image styles in #2822589: Followup: Allow image style to be selected in Text Editor - add preview.
- Fix any bugs.
- Add additional tests.
User interface changes
- The new ability to select a responsive image style.
- A new filter.
API changes
Not allowed.
Comments
Comment #2
rainbowarrayComment #3
damienmckennaComment #4
damienmckennaMarking Postponed until #2061377 gets in.
Comment #18
smustgrave commentedThank you for sharing your idea for improving Drupal.
We are working to decide if this proposal meets the Criteria for evaluating proposed changes. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or there is no community support. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #20
smustgrave commentedSince this was part of a follow up I'll put back.