Add support for selecting a responsive image style for the Photoswipe modal image, similar to the Thumbnail image style option

Created on 9 May 2025, 3 months ago

Problem/Motivation

There is currently no way to define a responsive image style for images displayed in the Photoswipe modal window when using the Photoswipe Responsive formatter.
In the Photoswipe Responsive formatter, it is currently possible to select a responsive image style for the Thumbnail image style field.
It would be logical and consistent to allow specifying a responsive image style for modal images in the same way, especially since responsive image handling is essential for modern web projects.

Steps to reproduce

Add a field with the Photoswipe Responsive formatter.

Try to set a responsive image style for images displayed in the modal window.

There is no option available to configure it β€” only the thumbnail image style is configurable.

Proposed resolution

Add a new setting to the Photoswipe Responsive field formatter that allows selecting a responsive image style for the modal image, similar to how it is already done for the thumbnail image.

Remaining tasks

Add a formatter setting for the modal responsive image style.

Update the formatter plugin to render images in the modal using the selected responsive style.

Adjust validation and fallback behavior.

Write/update tests if applicable.

User interface changes

A new dropdown/select field in the field formatter settings form to allow selecting a responsive image style for the modal image.

✨ Feature request
Status

Active

Version

5.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine Kostiantyn

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @Kostiantyn
  • πŸ‡ΊπŸ‡¦Ukraine Kostiantyn

    Provided implementation for supporting responsive image style for Photoswipe modal image . Please review.

  • Pipeline finished with Failed
    3 months ago
    Total: 365s
    #493154
  • Pipeline finished with Failed
    3 months ago
    Total: 291s
    #494802
  • Pipeline finished with Failed
    3 months ago
    Total: 295s
    #494910
  • Status changed to Needs review 11 days ago
  • πŸ‡©πŸ‡°Denmark ressa Copenhagen

    Thanks for adding this feature @kostiantyn. I was wondering just now what the difference is between the View modes "Photoswipe" or "Photoswipe Responsive", so I searched and found your issue.

    I am also not sure how to set up "Photoswipe Responsive", so perhaps you could consider add a small description in the README as well, outlining the basic steps to set up? Or if you leave a comment here, I will gladly go through it, and add it in the README via the MR.

    On a side note, I also hope captions can be made to work at some point, since that's also pretty much a requirement in modern web sites -- to have attribution of the images, but that's another issue ( πŸ› photo filed - caption Needs work ).

Production build 0.71.5 2024