Help with a gallery

Created on 6 December 2024, 5 months ago

The gallery at the bottom of the page https://www.gmpe.it/euganei/minerali-colli-euganei is created on Drupal 10 with Colorbox and a class: display none for all images, except the first one.
Is it possible to replicate it on Drupal 11 with Glightbox without using additional modules?

Thanks and kind regards

💬 Support request
Status

Active

Version

1.0

Component

Code

Created by

🇮🇹Italy giordy

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @giordy
  • 🇷🇸Serbia levmyshkin Novi Sad, Serbia

    Hi giordy,
    Possibly, Glightbox will open hidden images from links if you put the glightbox links in the same gallery:
    https://github.com/biati-digital/glightbox/blob/master/README.md

    <a href="large.jpg" class="glightbox3" data-gallery="gallery1">
      <img src="small.jpg" alt="image" />
    </a>
    <a href="video.mp4" class="glightbox3" data-gallery="gallery1" style="display: none;">
      <img src="small.jpg" alt="image" />
    </a>

    You can enable Glightbox Inline module (which is included in Glightbox module), then Glightbox library will be automatically added on all pages. And you will be able to use class="glightbox" for tag, for example:

    <a href="https://url.com/full-image.png">
      <img src="https://url.com/thumbnail.png">
    </a>

    For Body text inside CKEditor I use this module:
    https://www.drupal.org/project/image_resize_filter
    It creates lightbox link for resized images automatically.

    Then you can add style="display: none;" for your hidden extra images, to make it looks like a gallery.

  • 🇷🇸Serbia levmyshkin Novi Sad, Serbia
Production build 0.71.5 2024