Problem/Motivation

Good morning everyone, the problem is that the Lightbox doesn't work in a view.
The ul does not contain the "data-slick-lightbox-gallery" attribute

Steps to reproduce

Drupal core 9.2.13
Blazy: 8.x-2.13
Slick: 8.x-2.6
Slick Lightbox: 8.x-1.5
I developed a view of a gallery media type, which contains images media, supported types are image and video, the field shown is blazy multimedia, in the options I have selected what you see below
blazy multimedia settings

The gallery is shown but clicking it opens the image in a new browser window, the lightbox does not open.

Proposed resolution

I have looked at the code a bit, I have seen that in the file src/Plugin/views/style/BlazyViews.php the $settings does not contain 'lightbox.name' and causes the attribute not to be assigned, since in BlazyAttribute to assign the attribute uses that value

I have shared a patch that adds this data to the settings array, although I suppose there is a better solution, I hope it will be useful for you to find a complete way if you see it necessary to solve this problem.

blazy.patch

I hope I have explained myself.

Thank you very much and greetings.

Comments

Carlos Romero created an issue. See original summary.

carlos romero’s picture

Issue summary: View changes
carlos romero’s picture

gausarts’s picture

Component: Lightbox Integration » Regression
Status: Active » Needs review
Related issues: +#3257511: Optimization pre Blazy 3

Thank you.

Was fine at 2.5. An obvious regression.

To those who need clarity.
This is one of Blazy hidden features as found in Views Global group.
Normal Blazy field formatters are not the issue.

They are Views fields for File and Media to build multimedia gallery similar to those normally found at Node entity via field formatters, but these are custom Views fields.

Regarding the patch, we should collect other needed settings other than a lightbox name.
I will see if I can make it.

gausarts’s picture

Title: lightbox not working in a view » Lightbox gallery not working for Blazy custom Views fields
StatusFileSize
new3.8 KB

Added extra checks to address the issue.

Let me know if this works at your end.

carlos romero’s picture

3296139-gallery-regression-5.patch

Works fine in:

Drupal core 9.2.13
Blazy: 8.x-2.13
Slick: 8.x-2.6
Slick Lightbox: 8.x-1.5

Thank you very much and greetings.

  • gausarts committed ecd304e on 8.x-2.x
    Issue #3296139 by Carlos Romero, gausarts: Lightbox gallery not working...
gausarts’s picture

Status: Needs review » Fixed

Also fine with Slick:2.7-beta.
One more issue to address at the other thread, we should release a new one.

Committed. Thank you for contribution.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.