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

  1. Enable Token.
  2. Open the settings for a media image field using the GLightbox or GLightbox Responsive formatter.
  3. Select Custom (with tokens) for gallery, caption or caption description. Check the replacement-pattern section and browse the available tokens.
  4. 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

Command icon 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

nick hope created an issue. See original summary.

nick hope’s picture

Assigned: nick hope » Unassigned
Issue summary: View changes
Status: Needs work » Needs review
levmyshkin’s picture

I need to check it for images inside Media, Media inside Paragraph, Paragraph in inside Paragraph and other variations.

levmyshkin’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

levmyshkin’s picture

Status: Fixed » Closed (fixed)