From time to time the idea of adding custom fields to the ImageGallery has come up. As of the latest SVN, you can subclass the ImageGalleryPage object and specify your own classnames. Here's an example I used:
MyImageGalleryPage.php
class MyImageGalleryPage extends ImageGalleryPage
{
protected $itemClass = "MyImageGalleryItem";
protected $albumClass = "MyImageGalleryAlbum";
}
class MyImageGalleryPage_Controller extends ImageGalleryPage_Controller
{
}
MyImageGalleryAlbum.php
class MyImageGalleryAlbum extends ImageGalleryAlbum
{
static $db = array (
'ExtraAlbumField' => 'Text'
);
public function getCMSFields_forPopup()
{
$f = parent::getCMSFields_forPopup();
$f->push(new TextField('ExtraAlbumField'));
return $f;
}
}
MyImageGalleryItem
class MyImageGalleryItem extends ImageGalleryItem
{
static $db = array(
'NewField' => 'Text'
);
public function getCMSFields_forPopup()
{
$f = parent::getCMSFields_forPopup();
$f->push(new TextField('NewField'));
return $f;
}
}
Then of course you can create MyImageGalleryPage.ss, and MyImageGalleryPage_album.ss for your templates. Not very well tested, but seems to be working well.
Free at last!