Image Lightbox in widget or container

copywriter
82 Posts
copywriter posted this 28 January 2016

Hello, it's please possible adjust lightbox also for widgets or container? I found the settings for the content (post content). But if the image is placed into a widget, lightbox don't works. Thanks. Lucie

Hello, it's please possible adjust lightbox also for widgets or container? I found the settings for the content (post content). But if the image is placed into a widget, lightbox don't works. Thanks. Lucie
Vote to pay developers attention to this features or issue.
8 Comments
Order By: Standard | Newest
Stagger Lee
1818 Posts
Stagger Lee posted this 29 January 2016

Add Bootstrap Lightbox data-toggle="lightbox" to widget images, or whatever.

http://ashleydw.github.io/lightbox/

Add Bootstrap Lightbox data-toggle="lightbox" to widget images, or whatever. http://ashleydw.github.io/lightbox/
edwinverhoef
3 Posts
edwinverhoef posted this 02 March 2016

Hi Stagger Lee,

Could you please help me. Where should I place

data-toggle="lightbox"

in themler?

Hi Stagger Lee, Could you please help me. Where should I place > data-toggle="lightbox" in themler?
Support Team
Support Team posted this 03 March 2016

Hi,

In the code of your widget content, add the lightbox attribute to the image tag. That can be done within your site admin panel.

Sincerely,
Hella

Hi, In the code of your widget content, add the lightbox attribute to the image tag. That can be done within your site admin panel. Sincerely, Hella

Last edited 03 March 2016 by Support Team

edwinverhoef
3 Posts
edwinverhoef posted this 03 March 2016

Hi Hella,

So I will have to add the attribute to each image separately? It is not possible to automatically add this to all the images in a widget area?

Kind regards,
Edwin

Hi Hella, So I will have to add the attribute to each image separately? It is not possible to automatically add this to all the images in a widget area? Kind regards, Edwin
Stagger Lee
1818 Posts
Stagger Lee posted this 04 March 2016

I aded Bootstrap native things to images in widges and none of them trigger Lightbox or Bootstrap Modal box.

And there is no difference in image code when Lightbox is activated for Post content and when deactivated. Absolutely none, zero, not in one letter. It is done in JS, not with a, img classes and data attributes, and I dont know how to make it work for widget images. Have no clue.

I aded Bootstrap native things to images in widges and none of them trigger Lightbox or Bootstrap Modal box. And there is no difference in image code when Lightbox is activated for Post content and when deactivated. Absolutely none, zero, not in one letter. It is done in JS, not with a, img classes and data attributes, and I dont know how to make it work for widget images. Have no clue.
DetroitDave
3 Posts
DetroitDave posted this 06 March 2016

I'm wondering about all images that are not controlled by post content / lightbox. In artisteer there is a simple tag - class="art-lightbox" and it works great. I will add a 3rd party extension until this gets resolved.

I'm wondering about all images that are not controlled by post content / lightbox. In artisteer there is a simple tag - class="art-lightbox" and it works great. I will add a 3rd party extension until this gets resolved.
Stagger Lee
1818 Posts
Stagger Lee posted this 07 March 2016

Believe me there is no use of Bootstrap Lightbox / Modalbox. Get away from this and use some plugin. There are hundreds for this.

No slide between images, no click outside modal to close it.

Believe me there is no use of Bootstrap Lightbox / Modalbox. Get away from this and use some plugin. There are hundreds for this. No slide between images, no click outside modal to close it.
edwinverhoef
3 Posts
edwinverhoef posted this 07 March 2016

The problem was that I'm using the acf wysiwyg field and that the lightbox attribute wouldn't be passed through to the images inside it. Not even when using a plugin.
I found this code and it works perfectly:

<?php $wysiwyg = get_field('field_name', false, false); echo apply_filters('the_content', $wysiwyg);  ?>

Now the lightbox attribute does get passed by the acf.

The problem was that I'm using the acf wysiwyg field and that the lightbox attribute wouldn't be passed through to the images inside it. Not even when using a plugin. I found this code and it works perfectly: <?php $wysiwyg = get_field('field_name', false, false); echo apply_filters('the_content', $wysiwyg); ?> Now the lightbox attribute does get passed by the acf.
You must log in or register to leave comments