Ah ha. Ok, I've never used Gallery so I don't know what some of that code does.
If wanted to set the template from the CMS, here is one way you could do it. In the page class, add a template db field. Eg:
...
static $db = array(
"UseAlternateTemplate" => "Boolean"
);
...
function getCMSFields() {
$fields = parent::getCMSFields();
...
$fields->addFieldToTab('Root.Main', new CheckboxField('UseAlternateTemplate', 'Use Alternate Template'));
...
return $fields;
}
This gives a checkbox in the CMS to 'use the alternate template'.
Then, modify your page controller:
public function init() {
parent::init();
self::prototype2jquery();
Requirements::css('themes/clockwork_image_gallery/css/ImageGallery.css');
if(!isset($this->urlParams['Action'])) {
if($this->SingleAlbumView()) {
if($this->UseAlternateTemplate) {
return $this->renderWith(array('MyAlternateTemplate', 'Page'));
} else {
// note that I've changed 'die' to return - should be the correct way I think.
return $this->renderWith(array('ImageGalleryPage_album','Page'));
}
}
} else if($this->CurrentAlbum())
$this->includeUI();
}
None of the above is tested, but hopefully it helps.