Lightbox popup on photopage.
|
nlao
![]()
Joined: 2005-08-06
Posts: 18 |
Posted: Fri, 2009-08-21 13:16
|
|
Hi! I have been through a few tutorials on lightbox integration and have ploughed through greypop theme. The vast array of smarty tags is bewildering me. Can anyone suggest a nice way of getting lightbox to activate when the resized image (default view) on the photo page is clicked. Currently it opens a larger image that does not work so well with my website design. Here is my current setup. http://www.adamkimber.net/gallery/uni/album06/boderlands.jpg.html |
|


Posts: 18
Right for all of those people who want to have a lightbox popup on their photopage as a nice way of viewing the "fullsize" picture, the following should work.for when the photo is clicked
Note: these instructions are for Lightbox 2.04
1) Get Lightbox from http://www.huddletogether.com/projects/lightbox2/#download
2) Alter the template.tpl file in your theme to have the following lines
{* stylesheet and javascript for Lightbox JS *} <script type="text/javascript" src="{g->theme url="includes/js/prototype.js"}"></script> <script type="text/javascript" src="{g->theme url="includes/js/scriptaculous.js?load=effects,builder"}"></script> <script type="text/javascript" src="{g->theme url="includes/js/lightbox.js"}"></script> <link rel="stylesheet" href="{g->theme url="includes/css/lightbox.css"}" type="text/css" media="screen" /> {* end stylesheet and javascript for Lightbox JS *}3) Alter the line in your photo.tpl that currently reads, it is in the {if $image.viewInline} section which is inside the <div id="gsImageView" class="gbBlock"> section
<a href="{g->url params=$theme.pageUrl arg1="itemId=`$theme.item.id`" arg2="imageViewsIndex=`$imageViewsLink`"}" >to
<a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.item.id`"}" rel="lightbox" >=4) Some explanation - 2) activates the code for lightbox, the javascript the and css. 3) Alters the way gallery opens the file when the photo is clicked so it picks up the lightbox code. the rel"lightbox" bit is crucial
5) Now unpack the lightbox code from the downloaded zip
6) Create a folder in your gallery theme file called includes, you should now have templates, po, includes folders at this level now (maybe other folders too)
7) upload the contents of the unzipped lightbox file to your theme includes folder, you should now have in the includes folder css js images folders (maybe other folders too)
8) it should now work! (i hope)
OPTIONAL STUFF
A) If you want the title of the item to appear in the white frame at the bottom add the following, title="{$theme.item.title}", after the rel="lightbox" bit so it looks like this
<a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.item.id`"}" rel="lightbox" title="{$theme.item.title}">Currently I have problems with the image being loaded being the full size unaltered original, i.e. its not rotated, not watermarked etc. Any ideas?
.
Posts: 22892
Just guessing here:
to
or it should at least give a clue.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 18
Cheers Dave. You put me on the right track.
For those of you who want to use the "full size" non-original file, i.e. rotated and watermarked in the lightbox popup use the following....
<a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.imageViews[1].id`"}" rel="lightbox" title="{$theme.item.title}">Posts: 22892
Thanks for posting results for others. It helps the community.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team