Hello All,
I am working on trying to implement lightbox with G3.
I am very new to G3 and am trying to figure out how I would get the link to the image that shows up on the photo pages on the album page.
Any help would be great!
Edit album.html.php This will get you the URL for the resize image without any styling.
<?= $child->resize_img(array()) ?>
If you need/want to apply a css class to it: <?= $child->resize_img(array("class" => "g-lightbox-resize")) ?>
<?= $child->resize_img(array("class" => "g-lightbox-resize")) ?>
Where g-lightbox-resize is your class name. Choose any name you want.
Also, probably best to be using a copy of a theme since if you edit Wind any upgrades to G3 will overwrite your changes: http://codex.gallery2.org/Gallery3:Tutorials:Themes
____________________________________________ Like Gallery? Like the support? Donate now!!! See G2 live here
thanks this is getting close to what I need, but with the above code it outputs the URL but also an <img tag
eg.
<img src="/var/resizes/Wedding/Family01.jpg?m=1280893563" alt="Family 01" width="700" height="525"/>
where as what I need it to out put would be
<a href="/var/resizes/Wedding/Family01.jpg?m=1280893563" rel="lightbox[resize]">
Ah, dug around a bit. Try (I didn't test this)
<?= $child->resize_url(true) ?>
Just dinked around a bit more
That gives you the http://www.example.com/gallery3/var/resizes URL
This is without the domain name: <? echo $child->resize_url(false); ?>
<? echo $child->resize_url(false); ?>
works great thanks!!
For the full size url:
<? echo $child->file_url(true); ?>
or <? echo $child->file_url(); ?>
<? echo $child->file_url(); ?>
if you just need the relative path
And you may want to ultimately to check if the item is a photo or not:
<? if ($child->is_photo()): ?> <? echo $child->file_url(true); ?> <? endif ?>
And if you're doing this on the photo page instead of the album page you'd change $child to $item
Also, if you get this done it would be great if you could share your changes with the community.
This is what I ultimately ended up with, using the shadowbox module
<? if ($child->is_album()): ?> <a href="<?= $child->url() ?>"> <?= $child->thumb_img(array("class" => "g-thumbnail")) ?> <? else: ?> <a href="<?= $child->resize_url(true) ?>" rel="shadowbox[gallery]"> <?= $child->thumb_img(array("class" => "g-thumbnail")) ?> <? endif ?>
thanks for all your help!
Posts: 16503
Edit album.html.php This will get you the URL for the resize image without any styling.
<?= $child->resize_img(array()) ?>If you need/want to apply a css class to it:
<?= $child->resize_img(array("class" => "g-lightbox-resize")) ?>Where g-lightbox-resize is your class name. Choose any name you want.
Also, probably best to be using a copy of a theme since if you edit Wind any upgrades to G3 will overwrite your changes:
http://codex.gallery2.org/Gallery3:Tutorials:Themes
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 46
thanks this is getting close to what I need, but with the above code it outputs the URL but also an <img tag
eg.
where as what I need it to out put would be
Posts: 16503
Ah, dug around a bit. Try (I didn't test this)
<?= $child->resize_url(true) ?>____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 16503
Just dinked around a bit more
That gives you the http://www.example.com/gallery3/var/resizes URL
This is without the domain name:
<? echo $child->resize_url(false); ?>____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 46
works great thanks!!
Posts: 16503
For the full size url:
<? echo $child->file_url(true); ?>or
<? echo $child->file_url(); ?>if you just need the relative path
And you may want to ultimately to check if the item is a photo or not:
<? if ($child->is_photo()): ?> <? echo $child->file_url(true); ?> <? endif ?>And if you're doing this on the photo page instead of the album page you'd change $child to $item
Also, if you get this done it would be great if you could share your changes with the community.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here
Posts: 46
This is what I ultimately ended up with, using the shadowbox module
<? if ($child->is_album()): ?> <a href="<?= $child->url() ?>"> <?= $child->thumb_img(array("class" => "g-thumbnail")) ?> <? else: ?> <a href="<?= $child->resize_url(true) ?>" rel="shadowbox[gallery]"> <?= $child->thumb_img(array("class" => "g-thumbnail")) ?> <? endif ?>thanks for all your help!