Skip Navigation

[Résolu] Images and lightbox plugin

This support ticket is created Il y a 3 années et 1 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+00:00)

Marqué : 

This topic contains 11 réponses, has 2 voix.

Last updated by Jamal Il y a 3 années et 1 mois.

Assisted by: Jamal.

Auteur
Publications
#1960333

This appears to have only been a problem since the last update...

I use the plugin 'simple lightbox'. It has never before been a problem working with Toolset.
However, now I find that it will not work if it is a toolset image block

hidden link
On this post the top image is a WP default image block. It works perfectly with the lightbox plugin
The bottom image is a toolset image block - does not work with plugin.

I even tried a different lightbox plugin, but that didn't work either.

#1961387

Jamal
Supporter

Languages: Anglais (English ) Français (Français )

Timezone: Africa/Casablanca (GMT+00:00)

Hello and thank you for contacting the Toolset support.

Thank you for reporting clearly this issue. I only noticed that the Default WP Image has some additional attributes on the link wrapping the image hidden link
I am sure these attributes were added by the Simple Lightbox plugin. But I can't see a way yet to make the same for those links/images coming from Toolset.

Please reproduce this issue on our test site and I'll escalate it to our 2nd Tier. You can log in to our test site using the following link hidden link
Toolset plugins are already installed, just install the Simple Lightbox plugin, and reproduce the issue similarly to the page you shared and I'll take it from there.

#1961517

Plugin installed and activated, image uploaded, test post created

Strangely enough, not even the WP default image block is working on your site!!!

#1961825

Jamal
Supporter

Languages: Anglais (English ) Français (Français )

Timezone: Africa/Casablanca (GMT+00:00)

I think that the lightbox did not work on our test site because it uses a different theme than the one on your website.

Can you try with your theme and check again?

If it does not work with a default WordPress Image block, I am afraid, I can't escalate it as a compatibility bug with Toolset. In that case, you will have to reach to the plugin's authors for assistance. And get back to us for further assistance if needed.

#1961899

I uploaded my theme, parent and child, but it still doesn't work. Not sure why!

I have used the simple lightbox plugin on all my sites and it works perfectly, except now it does not work with toolset CPT. I suppose I can work round it on this particular site but doing away with toolset CPT and instead using WP featured image. I just hope I will always have a work around such as this one!

Really don't understand why it does not work on your site with the WP default block, but on about 30 of my different sites it works, as you can see for yourself! Also, it is not just with this lightbox plugin as I tried another, and I also tried with default WP theme and no other plugins except the lightbox and toolset

#1962625

Jamal
Supporter

Languages: Anglais (English ) Français (Français )

Timezone: Africa/Casablanca (GMT+00:00)

I don't really know why the default WordPress Image block is not opening in a lightbox, but I was able to make the Toolset Image block open in a lightbox. You can check it here hidden link

First, the Image Block needs to use a link to a lightbox. Check this screenshot hidden link
The, I added a custom code to activate Simple Lightbox on Toolset Images. Check this screenshot for a snippet I added in Toolset->Settings->Custom Code. Make sure to activate the snippet for the frontend hidden link

function simplelightbox_on_toolset_image( $block_content, $block ) {
	if ( function_exists( 'slb_activate' ) && ( $block['blockName'] === 'toolset-blocks/image' ) ) {
		return slb_activate( $block_content );
	}
	
	return $block_content;
}
 
add_filter( 'render_block', 'simplelightbox_on_toolset_image', 10, 2 );

Reference: hidden link

I hope this helps. Let me know if you have any questions.

#1962737

Hi Jamal.
thank you for that. I have to admit that I did not realise there was a link to lightbox and have just been using link to media as usual!

However, it still is not using simple lightbox. I can tell it's using Toolset's own new lightbox, even in the link you gave, as with simple lightbox there is a white border and it displays the caption - you can see this in the link in my first post. With Toolset's lightbox there is no border and it does not display the caption.

I believe Simple Lightbox stopped working when Toolset introducted their own. Normally that might be good enough, however I wish to display the caption on the pop-up, which Toolset does not do.

#1962823

Jamal
Supporter

Languages: Anglais (English ) Français (Français )

Timezone: Africa/Casablanca (GMT+00:00)

You are right, I am sorry, I don't know where I did a mistake during my tests. I thought that the lightbox does not work without the custom code. It turns out to be the Toolset Lightbox. Even if the Simple Lightbox plugin deactivated it still works. Which confirms what you say. It is a lightbox from Toolset.

However, even if I deactivate Toolset Blocks, the Simple Lightbox plugin does not work for the default WordPress Image.

I am afraid this gets us back to the previous step. As long as it does not work for the default WordPress block, we can't consider it to be an issue within the Toolset Image Block. If you can make the default WordPress Block work on lightbox we can check it again and see what's in there. Maybe you can reach to Simple Lightbox support and share the test site with them.

However, I'll escalate a feature request to our 2nd Tier to display the caption on the popup.

#1962887

Thank you Jamal.
My problem is that Simple Lightbox DOES work on all of my sites, and also the fact that I tried a different lightbox plugin, WP Featherlight, and that was exactly the same. I further tried with the default WP theme, which made no difference. This problem appears to have started when Toolset introduced their lightbox, as though it has disabled all other lightboxes.
If your developers are able to add the caption to the popup that would be great, but in the meantime it's a problem for me. I can't wait around and will have to design the website differently.

#1962915

I added WP Featherlight to your sandbox site.
This works in the default WP Image block, but does not work in the Toolset image block

It might well be if your developers can get this plugin to work, it will also work with simple lightbox.

I would also add that if there is no caption then the pop-up displays the alternative text, if none it will display the file name

#1963673

Hi Jamal
Just to let you know...
On a Facebook group somebody, who was also having problems with the Toolset lightbox, showed me the snippet below in order to disable it. The only thing is that other lightbox plugins do not seem to recognise a toolset image custom field, so the only thing I can do is to not use them and develop the site in another way.
Thanks for trying to help.

add_action("wp_print_footer_scripts", "ts_dequeue_scripts", 1 );
function ts_dequeue_scripts( $handles ){
wp_dequeue_script( "lightbox" );
}

#1964013

Jamal
Supporter

Languages: Anglais (English ) Français (Français )

Timezone: Africa/Casablanca (GMT+00:00)

Thank you very much for sharing this code. I did not take the chance to try it because the "WP Featherlight" plugin's lightbox works with Toolset one without issue. We just need to deactivate the lightbox on the Toolset Image block. hidden link

You will notice on the following screenshot that the "WP Featherlight" lightbox is adding the image's caption. hidden link

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.