(solved) Imageblock + lightbox integration

Pauwel

Joined: 2011-02-03
Posts: 5
Posted: Thu, 2011-02-24 10:24

Hi,

I would like to combine lightbox and imageblock. How do I do that?

I got my imageblock running, simply by:
{g->block type="imageblock.ImageBlock" blocks="recentImage" exactSize=320}

and I can have a lightbox running by adding the rel to a link as in:
<a href="" rel="lightbox[photos]">

But how do i combine those two?

Thank you!

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2011-02-24 12:53

You can either edit gallery2/modules/imageblock/templates/blocks/ImageBlock.tpl

Or use mediaBlock with which others have done the same.

Also you can have jQuery add the class to your selector before the lightbox script executes.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
Pauwel

Joined: 2011-02-03
Posts: 5
Posted: Thu, 2011-02-24 14:07

Hi, thanks for the swift reply.

I dont know if I'm asking you too much but:

if I add the rel="lightbox" to the ImageBlock.tpl the lightbox keeps on loading without showing the image (meaning it can't find the image, the actual goal, as it is not cleary specified I guess).

right now the link is:
<a href="{$linkHref}"{if !empty($ImageBlockData.linkTarget)} target="{$ImageBlockData.linkTarget}"{/if} rel="lightbox">

should I change the href statement? to what?

thanks again!

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2011-02-24 14:59

The problem is that gallery links the image to the image's page in gallery, not simply the image.

try editing gallery2/modules/imageblock/templates/ImageBlock.tpl line 13-14:

      {g->url arg1="view=core.ShowItem" arg2="itemId=`$block.id`"
	      forceFullUrl=$ImageBlockData.forceFullUrl}

to:

      {g->url arg1="view=core.DownloadItem" arg2="itemId=`$block.id`"
	      forceFullUrl=true}

don't forget to clear your template cache

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
Pauwel

Joined: 2011-02-03
Posts: 5
Posted: Thu, 2011-02-24 16:24

Yes yes master! It did the trick. Got to resize the shown item now, but for now I'll try to find out how myself. Its a learning process anyway! :-)

Thanks mate!