Uncle Cheese,
I was wondering if you could replace you init function in ImageGalleryPage.php from:
public function init()
{
parent::init();
self::prototype2jquery();
Requirements::css('image_gallery/css/ImageGallery.css');
if(!isset($this->urlParams['Action'])) {
if($this->SingleAlbumView()) {
die($this->renderWith(array('ImageGalleryPage_album','Page')));
}
}
else if($this->CurrentAlbum())
$this->includeUI();
}
To:
public function init()
{
parent::init();
self::prototype2jquery();
Requirements::css('image_gallery/css/ImageGallery.css');
if ($this->useTemplate == "ImageGalleryPage_album"){
if(!isset($this->urlParams['Action'])) {
if($this->SingleAlbumView()) {
die($this->renderWith(array('$this->useTemplate','Page')));
}
}
else if($this->CurrentAlbum())
$this->includeUI();
}
}
And add:
public $useTemplate = "ImageGalleryPage_album";
Also to make this work function includeUI() needs to be change to protected instead of private.
This way people who extend the class can define their own template. Otherwise the die() in your init kills the init of the child class.
This change should be backwards compatible and not mess with anyones galleries if they do not extend them the way I do.
I understand if you don't want to make this change, but it sure would be nice since I use the image_gallery a lot on different sites but almost always extend it for my own specific use. I like to retain upgradability so I do not want edit your code at all and do all my customization in my own code folder.
Thanks.