WBCE Home | WBCE Hilfe | WBCE Addon Repository | Impressum | Datenschutz

WBCE CMS Forum

WBCE CMS – Way Better Content Editing.

You are not logged in.

#1 08.10.2019 16:50:40

losttrip
Member

Caption text not displaying in Lightbox image

When I enter text in the "caption" dialogue for an item image, it does not show in the lightbox of that image. And this is the resulting html

<span class="lb-caption" style="display: none;"></span>

If I enter text in the "HTML title Attribute" of an item image, the title is shown as the lightbox caption.

<span class="lb-caption" style="display: inline;">test</span>

Is there a reason for this?  Is the Caption content used elsewhere?

Online

#2 08.10.2019 17:44:59

florian
Administrator

Re: Caption text not displaying in Lightbox image

Which version of OfA is that?

Offline

#3 08.10.2019 17:50:52

losttrip
Member

Re: Caption text not displaying in Lightbox image

Sorry.

OFA 1_oneforall_v1.0.10 which I downloaded from here:
https://addons.wbce.org/pages/addons.php?do=item&item=9

Online

#4 08.10.2019 18:02:50

florian
Administrator

Re: Caption text not displaying in Lightbox image

This is rather strange. I have no idea where lb-caption does come from. The code which is generated in the view_item.pphp actually reads

<div class="mod_'.$mod_name.'_item_caption_f">

what usually results in <div class="mod_oneforall_item_caption_f">.
On the other hand, in the frontend.css and frontend.js there are classes defined for lb-caption (and lb obviously means lightbox), but it seems as if this was not implemented completely.

Are you sure that that code results from OfA and not from RFG or Minigal or Itemz or sth. like this?

Offline

#5 08.10.2019 18:22:51

losttrip
Member

Re: Caption text not displaying in Lightbox image

It's just OFA as far as I understand.  This is what the inspection of the caption on the frontend shows, if that might help:
caption display none

Online

#6 08.10.2019 18:35:33

florian
Administrator

Re: Caption text not displaying in Lightbox image

Ah, I see. That is dynamically generated HTML by the lightbox script. To add the caption text, change in the view_item.php line ~396

$prepend = '<a href="'.$img_url.$image_file.'" rel="lightbox[image_'.ITEM_ID.']" title="'.$img_title.'"><img src="';

to

$prepend = '<a href="'.$img_url.$image_file.'" rel="lightbox[image_'.ITEM_ID.']" title="'.$img_title.' '.$img_caption.'"><img src="';

Offline

Liked by:

losttrip

#7 08.10.2019 19:21:12

losttrip
Member

Re: Caption text not displaying in Lightbox image

Thank you once again for your kind guidance.

Because I have my lightbox2 set to Overview, not Item Detail:
lightbox2

I also made your suggested addition in line ~ 360 of view_overview.php
from

$img_prepend   = '<a href="'.$img_url.$image_file.'" rel="lightbox[image_'.$item_id.']" title="'.$img_title.'"><img src="';

to:

$img_prepend   = '<a href="'.$img_url.$image_file.'" rel="lightbox[image_'.$item_id.']" title="'.$img_title.' '.$img_caption.'"><img src="';

And it is working beautifully.

Cheers!

Online

Liked by:

florian

Board footer

Powered by FluxBB

up