Allow responsive image style to be selected in Text Editor's image dialog (necessary for structured content)

Created on 26 October 2016, almost 9 years ago
Updated 26 August 2025, about 2 months ago

Follow-up to Allow image style to be selected in Text Editor's image dialog Needs work

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

  1. 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.
  2. Potentially move responsive image style preview to a separate issue, as is being in doing with image styles in Followup: Allow image style to be selected in Text Editor - add preview Postponed: needs info .
  3. Fix any bugs.
  4. Add additional tests.

User interface changes

  • The new ability to select a responsive image style.
  • A new filter.

API changes

Not allowed.

Feature request
Status

Postponed: needs info

Version

11.0 🔥

Component

editor.module

Created by

heddn Nicaragua

Live updates comments and jobs are added and updated live.
  • mobile

    Issue related to Drupal on mobile devices.

  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States smustgrave

    Thank 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!

Production build 0.71.5 2024