Yeah, the decorators have been giving me grief. I didn't think it would work to extend the ImageGalleryItem directly since the ImageGalleryPage class includes the ImageGalleryItem in its has_many array, which would mean editing the ImageGalleryPage class, defeating the purpose of separating my additions into a separate module. However, after thinking about it a bit, your suggestion may actually work, since I CAN decorate the ImageGalleryPage successfully... I'll try it this afternoon.
On an entirely unrelated note, I'm also working on a module that organizes various SilverStripe features into a package for user-management. In working on this, I noticed that the die() statement used to render a single album gallery breaks the built-in SS security model. For example, if you create a Page with Access set to a specific user-group, then make a Image Gallery Page as a child of the secured page, it is still possible to access the gallery via its URL if there is only one album because the die() statement stops further PHP execution. My quick fix was to change the die() to a redirect like this:
if($this->SingleAlbumView()) {
//FIX: changed die() to redirect to only album in order to solve security issue...
$gallery_ID = $this->data()->getField("ID");
$gallery_URLSegment = $this->data()->getField("URLSegment");
$album = ImageGalleryAlbum::get_one("ImageGalleryAlbum", "ImageGalleryPageID = ".$gallery_ID);
$album_URL = $gallery_URLSegment.'/album/'.$album->Folder()->Name;
Director::redirect($album_URL);
//die($this->renderWith(array('ImageGalleryPage_album','Page')));
}
The URL isn't as pretty, but it fixes the security issue... any thoughts on a better way to do this?