Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Image gallery different view


6 Posts   1426 Views


11 June 2009 at 11:14am Community Member, 7 Posts

Hi, I'm pretty new with Silverstripe but mostly with the Image Gallery. I know a bit of PHP but I don't know where to start in this case.

I don't want to open the photos in any of the options given, I'd like to open them in a page like any normal page. Any tips where to start with this? I don't really like the lightbox/javascript things, I want something more simple.



11 June 2009 at 3:20pm 4085 Posts

The right way to do it would be to extend the class into your custom implementation, but if you're new to SS and PHP, here's a possible hack of a solution.

Set the images per page to 1, set the thumbnail width to something large, say, 640px, and set the popup style to "none"

Ostensibly, that would have the same effect, wouldn't it? :)


11 June 2009 at 6:38pm Community Member, 7 Posts

In some way, yes it would be similar, but I'd lose the album view if I do that. If I have about 50 photos in the same album, and you want to look at a specific photo, it a bit more complicated for the end user.

I guess I'll have to live with the Javascript, I can't seem to understand how to do it, it's more complicated than dealing with Pages and Holders as shown in the docs ;) .

Thanks anyway.



12 June 2009 at 2:16am 4085 Posts

You would still have the album navigation in the subnav. Keep in mind you should be copying the ImageGallery templates into your mysite directory so you can customize them.

If you wanted images in lieu of numbers for pagination, you could do something like this:

function GalleryPagination()
$pages = new DataObjectSet();
foreach($this->GalleryItems() as $item) {
$pages->push(new ArrayData(array(
'ThumbnailURL' => $item->Image()->CroppedImage(50,50)->URL,
'Link' => $this->CurrentAlbum()->Link()."?start=".$i;

Then something like

<% control GalleryPagination %>
<li><a href="$Link"><img src="$ThumbnailURL" /></a></li>
<% end_control %>

Easy peasy!


12 June 2009 at 5:14am Community Member, 7 Posts

Something's not working with that, but I should be able to figure it out. Thanks a lot for that tip!

Ryan M.

5 January 2010 at 1:21pm Community Member, 309 Posts

I'm trying to do this and I would like to know if anybody has any success in getting something like this to work? If so, please post your code.

What I want to do is change the thumbnail links to link to an image page instead of the lightbox things, so members can comment on & rate the images. The comments & ratings will be my own modifications as well.