Skip Navigation

[Résolu] Display caption image in lightbox

This support ticket is created Il y a 2 années et 9 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 2 réponses, has 2 voix.

Last updated by jesusM-6 Il y a 2 années et 9 mois.

Assisted by: Jamal.

Auteur
Publications
#2116781
soporte toolset 03.jpg
soporte toolset 02.jpg

Hola!

Mi problema es el siguiente:
Tengo un slider de imágenes donde muestro el caption sin problema (soporte toolset 02.jpg), pero necesito mostrarlo también cuando se muestra en el lightbox (soporte toolset 02.jpg).

Gracias

#2117415

Jamal
Supporter

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

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

Hello and thank you for contacting Toolset support.

Our Spanish-speaking supporter, Nigel, does not work on weekends. If you don't mind, I'll reply to you on this ticket. If you would prefer to continue in Spanish, let me know and I'll pass this ticket to Nigel.

I am afraid, this option is not available within the Toolset Lightbox. If you need this feature, please suggest it on this form, our product manager will evaluate it and plan it for an upcoming development effort.
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

As a workaround, you can add the caption to the lightbox using Javascript. The trick is to add a data-title to the lightbox handler. I tested it on a clean install, and I could build it. You can login into my test site with the following URL hidden link

First, I have added a class to the image block to easily target it with Javascript. Check this screenshot hidden link
Then, I added the following code to my content template:

jQuery(function($){
  var figure = $('.my-image')
  var caption = figure.find('figcaption').text()
  var link = figure.find('a')
  link.attr('data-title', caption)
})

Check the results here hidden link
Check this screenshot hidden link

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

#2120039

My issue is resolved now. Thank you!

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