• Hello Support,

    in first of all -> great plugin.

    But i have a little problem, i have to display data-attribute-description below thumbnail. I’ve try do it with javascript, but variable data-lbwps-description from first element put to all elements with lightbox. Do you have any tips to display data-lbwps-description every picture below thumbnail?

    I’ve been very gratfull for any tips.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Arno Welzel

    (@awelzel)

    The content of data-lbwps-description is just the description of the images taken from the media library. This is either the caption or the description of the image.

    Your theme or gallery needs to add this data to the thumbnails – it makes no sense to read attributes from the image links if you already have this data in WordPress and just need to use it.

    For example like this on my demo website:

    https://wordpress-demo.arnowelzel.de/lightbox-with-photoswipe/

    Or as on my own website (descriptions will show when you hover the thumbnails with the mouse):

    https://arnowelzel.de/en/hdsp-211x-for-raspberry-pi

    Please consult the documentation of your theme or gallery plugin how add image captions or image descriptions to the thumbnails.

    Thread Starter cukier

    (@cukier)

    I’m sorry for late reply.

    Thanks for Answer I had to copy data-lbwps-description to custom div. I wrote small jQuery script and works fine:

    <script>
      jQuery('document').ready(function () {
                window.setTimeout(function () {
                    jQuery('.wp-block-getwid-images-slider__item a').each(function () {
                        var htmlText = jQuery(this).attr('data-lbwps-description');
                        jQuery(this).append('<div class="tr-slide-desc">'+htmlText+'</div>');
                    });
                }, 600);
    
            });
    </script>

    But i have one more issue. I use Lightbox with PhotoSwipe with image slider form Getwid Blocks plugin. Lightbox works beatifull with single images on page or wordpress galleries, but when i use image slider from getwid blocks with single images on page lightbox works only on active thumbnail from image slider and after click to next image lightbox go to another block with image or image slider block.

    I searched another topics and i find out lightbox works only with images with data-width and data-height, but in source code all images has this data attribtues.

    EDIT:

    I check it one more time and I think this issue is related with attribute tabindex in link to image. Tabindex with next image in image slider block is -1 and thats why lightbox does not show it in slideshow.

    Do you have any tips on how to get a lightbox to work with image links a with tabindex -1?

    • This reply was modified 4 years, 11 months ago by cukier.
    • This reply was modified 4 years, 11 months ago by cukier.
    • This reply was modified 4 years, 11 months ago by cukier.
    Plugin Author Arno Welzel

    (@awelzel)

    No – tabindex has nothing to do with this. The tabindex will just be used to change the order of the images in the lightbox. It does not matter which value it has. -1 is completely fine.

    However Lightbox with Photoswipe only works with images which are part of the final HTML code sent to the browser. Images which are only added in the frontend using JavaScript don’t work at all. If the Getwid Blocks image slider adds the images using a frontend JavaScript, it is not compatible with Lightbox with Photoswipe, sorry.

    Also note that all data-lbwps- attributes are added by Lightbox with Photoswipe itself by examining the HTML code before it is sent to the browser and adding these attributes for the frontend script.

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

The topic ‘data-lbwps-description below thumbnail’ is closed to new replies.