• Resolved j.johnston

    (@jjohnston-1)


    Hi Sayontan,

    I’m using the Photonic plugin with the LightGallery lightbox. By default LightGallery overlays the photo caption on the bottom edge of the image, and this makes the white caption text unreadable on a light coloured image. LightGallery provides a setting** (allowMediaOverlap: false,) to force the caption to be displayed below the image, instead of on the image, to handle this situation. I don’t know what version of LightGallery is included in Photonic, but there doesn’t seem to an option to allow this setting to be toggled.

    Am I just not seeing this option? Is this an option that could be included in Photonic, or should I be using a different lightbox?

    ** https://www.lightgalleryjs.com/docs/settings/#allowMediaOverlap

    Thank you very much!

    WordPress 6.1.1 running Pictorico theme 1.09.7.
    PHP version: 8.0.23
    Photonic 3.02
    Image source: Google Photos

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Sayontan Sinha

    (@sayontan)

    The documentation is flipped – allowMediaOverlap of true allows the captions to overlap, not the other way round. If you look at the demos, take a look at the demo for “Static thumbnails”, or “Customize more”, both of which set allowMediaOverlap: true. The default setting is false, so overlapping shouldn’t be happening by default.

    If you are seeing an overlap, please provide me with a URL, and I can take a look.

    Thread Starter j.johnston

    (@jjohnston-1)

    Hi Sayontan,

    Sorry for the very late reply. I haven’t been able to revisit this until now.

    This was a bit of a confusing situation to figure out, but here’s what I’ve determined:

    When using the LightGallery lightbox, the initial height of the image depends on the presence of a caption.

    • If I launch the lightbox from an image thumbnail that has a caption, then the full-size image is vertically centered and the caption is below the image. This is good.
    • However, if I launch the lightbox from an image thumbnail having no caption, then the full-size image is initially enlarged to occupy the bottom of the screen where the caption would be. When I then navigate within the lightbox to an image with a caption, then the caption is positioned on the image, instead of below it. The problem is that the image isn’t being subsequently resized to allow space for the caption to be positioned below it.

    The problem seems to be in the LightGallery library. I have been able to solve the problem locally by adding the following custom CSS to force the space allocated to the caption to always have a height:

    .lg-outer .lg-empty-html.lg-sub-html, .lg-outer .lg-empty-html .lg-sub-html {
    display: block;
    height: 50px;
    }

    Now the full-size image in the lightbox is always at the correct height to allow a caption, whether there is one present or not, to work around the lack of image resizing code in the library. Of course this might only work for single unwrapped lines of captions, but that’s better than my current situation.

    Thanks!

    Plugin Author Sayontan Sinha

    (@sayontan)

    Interesting… thank you for the update!

    I am marking this resolved, but do let me know if you require additional assistance.

    Thread Starter j.johnston

    (@jjohnston-1)

    Perfect, thanks again!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Support for LightGallery caption placement?’ is closed to new replies.