Problem/Motivation
Both image formatters apply the token-browser theme to its wrapper, losing the replacement-pattern section and its visibility rules. The entity token category can also be missing, and conditional settings do not work correctly in Views.
Steps to reproduce
- Enable Token.
- Open the settings for a media image field using the GLightbox or GLightbox Responsive formatter.
- Select Custom (with tokens) for gallery, caption or caption description. Check the replacement-pattern section and browse the available tokens.
- Repeat in a View using a media image field. Switch between custom and non-custom options and check which controls remain visible.
Proposed resolution
Render the token link inside a details element, obtain the entity type from the field definition, and use visibility selectors that work in both display and Views settings.
The equivalent remote-video fix is #3628598.
Local testing
Browser checks on Drupal 11.4.8 pass for both formatters using display and Views-style forms: the token dialog includes Media tokens, and conditional settings work.
Remaining tasks
Review MR (testing in the administration forms) then merge MR.
Issue fork glightbox-3628614
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
nick hope commentedComment #4
levmyshkinI need to check it for images inside Media, Media inside Paragraph, Paragraph in inside Paragraph and other variations.
Comment #6
levmyshkinComment #8
levmyshkin