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

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.
I hope I have explained myself.
Thank you very much and greetings.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 3296139-gallery-regression-5.patch | 3.8 KB | gausarts |
| blazy.patch | 1.03 KB | carlos romero | |
| blazy multimedia settings.png | 114.72 KB | carlos romero |
Comments
Comment #2
carlos romero commentedComment #3
carlos romero commentedComment #4
gausarts commentedThank 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.
Comment #5
gausarts commentedAdded extra checks to address the issue.
Let me know if this works at your end.
Comment #6
carlos romero commented3296139-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.
Comment #8
gausarts commentedAlso 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.