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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Gallery: show image details

Go to End

29 Posts   6239 Views


Community Member, 182 Posts

13 November 2009 at 10:07am

Hello again,

I've just installed this mod again for another site and added the MyImageGalleryPage subclass which comes up in the CMS,
The actual albums and their content are just blank! the page is there is just has nothing on it, only what is typed in the content area.
I can't figure out what I forgot to add... The standard ImageGalleryPage works just fine.
Also adding "SortableDataObject::add_sortable_class("MyImageGalleryItem");" to the config is causing a PHP error, perhaps these are related?
Help appreciated im stuck!!

Many thanks!


Community Member, 182 Posts

13 November 2009 at 11:20am

Strangely enough after changing the page type to ImageGalleryPage, it now works... including all the title extensions etc. does that seem strange?


Community Member, 97 Posts

28 January 2010 at 3:14am

I am tring to do the same thing My code is


class MyImageGalleryItem extends ImageGalleryItem
static $db = array (
'PaintingName' => 'Varchar(100)',
'PaintingDimensions' => 'Varchar(50)',
'Media' => 'Varchar(50)'


public function getCMSFields_forPopup()
$f = parent::getCMSFields_forPopup();
$f->push(new TextField('PaintingName','Name of painting'));
$f->push(new TextField('PaintingDimensions','Dimensions of painting'));
$f->push(new TextField('Media','Media'));
return $f;


class MyImageGalleryPage extends ImageGalleryPage {
protected $itemClass = "MyImageGalleryItem";

//class MyImageGalleryPage_Controller extends ImageGallery_Controller {
class MyImageGalleryPage_Controller extends ImageGalleryPage_Controller {


the upper two files are inside code under /mysite/code

and /blackcandy/templates/Includes/
<% if GalleryItems %>
<ul class="gallery-layout" id="gallery-list">
<% if GalleryItems.NotFirstPage %>
<% control PreviousGalleryItems %>
<li style="display:none;">$GalleryItem</li>
<% end_control %>
<% end_if %>
<% control GalleryItems %>
<li style="height:{$ThumbnailHeight}px;width:{$ThumbnailWidth}px;">

<% end_control %>
<% if GalleryItems.NotLastPage %>
<% control NextGalleryItems %>
<li style="display:none;">$GalleryItem</li>
<% end_control %>
<% end_if %>
<% end_if %>

and i have done dev/build

though the page is there and its creating a new template but when I am opening the page there is no image even though i have added a new album and image in this page.I need to print a image name below the image
there is no error also
Please help me.
thank you in advance


Community Member, 182 Posts

28 January 2010 at 4:09am

I had this problem sometimes... UncleCheese may disagree with me but if you've set your page type to "MyImageGallery" in the CMS (which I'm sure you have) make sure you have a template called and in the folder:

image_gallery > templates > Layout

I simply duplicated the original template files and changed the file names. However I did not need to do this for one of my sites for some reason.. and you may be able to put them in your theme template folder not sure haven't checked, UC would know better than I.

See how that goes.


Community Member, 211 Posts

5 March 2011 at 12:47am


Following the instruction I have managed to make things work as far as having the new picture details ('PaintingName' etc) showing under the thumbnail of the image.

Now (i'm using lightbox) I'm trying to have them show in the popup (big image) .

Is there a template for that or is it some coding ?


Go to Top