7921 Posts in 1359 Topics by 933 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Getting images in ImageGallery to appear in a templated page?
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 830 Views |
-
Getting images in ImageGallery to appear in a templated page?

2 July 2009 at 5:38am
Hi all,
I need to get the images that are displayed in the gallery to appear in the the normal templated page when a thumbnail is clicked. I have set the pop up to 'none' but that just displays the image and nothing else.
Any ideas?
Cheers
-
Re: Getting images in ImageGallery to appear in a templated page?

2 July 2009 at 6:17am
It's not really set up to do that, but you could do it pretty easily by subclassing it out. Some pseudo-code:
class MyImageGalleryPage_Controller extends ImageGalleryPage_Controller
{
function image()
{
return $this->customise(array('Item' => DataObject::get_by_id("ImageGalleryItem",$this->urlParams['ID'])))->renderWith(array('MyImageGalleryPage_image','Page');
}
}MyImageGalleryPage_album.ss:
<% control GalleryItems %>
<li style="height:{$Top.ThumbnailSize}px;width:{$Top.ThumbnailSize}px;">
<a href="<% control Top %>$Link(image)<% end_control %>$ID"><img src="$ThumbnailURL" alt="$Title"/></a>
</li>
<% end_control %>MyImageGalleryPage_image.ss
<% control Item %>
$Image.SetWidth(500)
$Caption
<% end_control %>Something like that oughta work.
-
Re: Getting images in ImageGallery to appear in a templated page?

2 July 2009 at 7:01am
Thanks. Will have try with that.
| 830 Views | ||
|
Page:
1
|
Go to Top |

