- Issue created by @handkerchief
- 🇷🇸Serbia levmyshkin Novi Sad, Serbia
Hi handkerchief, GLightbox module has the same settings as Colorbox module:
https://www.drupal.org/project/colorbox →It looks like you need this functionality, but in GLightbox:
https://www.drupal.org/project/colorbox/issues/2957030 ✨ Allow media entity reference fields to be displayed as a gallery in a colorbox Needs reviewI tested GLightbox two separate galleries and they can work separately. I used EPT Image Gallery module:
https://www.drupal.org/project/ept_image_gallery →
EPT Image Gallery uses paragraphs with Media fields inside:
Media Images use view mode EPT Image Gallery and in this view mode I used setting "GLightbox gallery type: Per post gallery" for GLightbox image field widget.
Then I created two paragraphs with Media images:
These galleries are working separately from each other:
For me it's working fine without the patch. Ping me if you need more information or help.
- Status changed to Closed: works as designed
7 months ago 4:22pm 15 April 2024 - 🇨🇭Switzerland handkerchief
Hi @levmyshkin
Thank you very much for your fast reponse.
Colorbox, yes that's the case. I have already initiated this for Juicebox, where it now works correctly:
https://www.drupal.org/project/juicebox/issues/2996745 →In your showcase gif: As far as I can see, you have 2 images per gallery. And if you click on an image in a gallery and then switch the images back and forth in the lightbox, the same image is always displayed. But it would be correct if it switched between the 2 images in the gallery, correct? Is this currently possible without an additional code?
- Status changed to Needs review
7 months ago 9:39am 16 April 2024 - 🇨🇭Switzerland handkerchief
It took me a while because I had to study the module and chose the colorbox approach first. But it's much easier, here's the patch.
This allows you to select the GLightbox formatting from the media reference field within the paragraph entity type. The settings remain the same as in your screenshots. But I do not use ept_image_gallery.
It works for me now. It would be great if you could also test or optimize it. If I can also maintain the module, just add me.
-
levmyshkin →
committed 2e9aa8b3 on 1.0.x
Issue #3441105 by handkerchief: Add support for Images and Videos...
-
levmyshkin →
committed 2e9aa8b3 on 1.0.x
-
levmyshkin →
committed b9e21d85 on 1.0.x
Issue #3441105 by handkerchief: Add support for Media field and...
-
levmyshkin →
committed b9e21d85 on 1.0.x
- 🇷🇸Serbia levmyshkin Novi Sad, Serbia
Oops.. It didn't work as expected. I tried to apply this approach from Colorbox/Colorbox Media modules:
https://www.drupal.org/project/colorbox/issues/2957030 ✨ Allow media entity reference fields to be displayed as a gallery in a colorbox Needs reviewBut it will not work with Glightbox, at least without building list of elements in javascript:
So I added new options for GLightbox field formatter:
- Per parent entity gallery (e.g. Media field or Paragraph with video fields)
- Per paragraph gallery (e.g. Paragraphs with Media fields
Per parent entity gallery will work for Node -> Media Fields or Paragraph -> Media Fields (mutliple medias in one field). For example it will be working for EPT Image gallery module:
https://www.drupal.org/project/ept_image_gallery →Per paragraph gallery (e.g. Paragraphs with Media fields will work for Node -> Paragraphs (multiple field) -> Media field (single image or video). There is nested entities and we need to get parents one by one. It matches for EPT Video and Image gallery module and allows to display image and videos as one gallery:
https://www.drupal.org/project/ept_video_and_image_gallery →I pushed changes in 1.0.x branches for Glightbox and Glightbox Media Video
https://www.drupal.org/project/glightbox_media_video →I will test this functionality and add a new release later.
- Status changed to Fixed
7 months ago 11:14am 16 April 2024 Automatically closed - issue fixed for 2 weeks with no activity.
- 🇷🇸Serbia levmyshkin Novi Sad, Serbia
Hi handkerchief, I added you as a maintainer. I fixed the problem with gallery for paragraph, but if you have any ideas you are welcome to update codebase.