Item9183: Plugin is adding a empty first image when using lightbox as frontend

pencil
Priority: Normal
Current State: No Action Required
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: ImageGalleryPlugin
Branches:
Reported By: JuanPabloGaviria
Waiting For:
Last Change By: MichaelDaum
When i use %IMAGEGALLERY{frontend="lightbox" size="small" include=".(png|jpg|jpeg|bmp)$" skip="0"}% then click the thumbnail, the overlay appears and showme N+1 images, where the first is an empty image.

Checking the code, i found that when the frontend parameter is set to lightbox and no custom header parameter, the plugin set the header parameter to:
    $this->{header} = "<noautolink><div class=\"igp jqSlimbox {itemSelector:'.igpThumbNail', singleMode:true}\" id='igp$this->{id}'>\n<a name='igp$this->{id}'></a>\n";

And the Slimbox JQueryPlugin take the
"<a name='igp$this->{id}'></a>\n"
as the first image to show in the overlay.

To fix that problem you have access to the foswiki server, go to the foswiki-root/lib/Foswiki/Plugins/ImageGalleryPlugin/Core.pm line 290:
     $this->{header} = "<noautolink><div class=\"igp jqSlimbox {itemSelector:'.igpThumbNail', singleMode:true}\" id='igp$this->{id}'>\n<a name='igp$this->{id}'></a>\n";
and change it for:
>     $this->{header} = "<noautolink><div class=\"igp jqSlimbox {itemSelector:'.igpThumbNail', singleMode:true}\" id='igp$this->{id}'>\n";

the diff:
diff Core.pm.org Core.pm 
290c290
<     $this->{header} = "<noautolink><div class=\"igp jqSlimbox {itemSelector:'.igpThumbNail', singleMode:true}\" id='igp$this->{id}'>\n<a name='igp$this->{id}'></a>\n";
---
>     $this->{header} = "<noautolink><div class=\"igp jqSlimbox {itemSelector:'.igpThumbNail', singleMode:true}\" id='igp$this->{id}'>\n";

-- JuanPabloGaviria - 22 Jun 2010

Does not apply anymore.

-- Main.MichaelDaum - 27 Jul 2017 - 11:47

ItemTemplate edit

Summary Plugin is adding a empty first image when using lightbox as frontend
ReportedBy JuanPabloGaviria
Codebase 1.0.9, 1.0.8
SVN Range
AppliesTo Extension
Component ImageGalleryPlugin
Priority Normal
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release02x01Checkins
Release02x00Checkins
Release01x01Checkins
Topic revision: r2 - 27 Jul 2017, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy