Hi I have started working on this : the GalleryFolder page type is an example of gallery images being displayed on a parent page. The only problem with this is that the ChildGalleries function gives a hard job to the server when images have not been resized yet by sub galleries. Complete package with template is available on my jquery gallery module implementation
/**
* Defines the GalleryFolder page type
*/
class GalleryFolder extends Page {
static $db = array(
);
static $has_one = array(
);
// static $allowed_children = array('GalleryPage', '');
}
class GalleryFolder_Controller extends Page_Controller {
function ChildGalleries( ) {
$ChildGalleries = DataObject::get("GalleryPage", "ParentID = " . $this->ID);
//? DataObject::get("ArticlePage", "ParentID = $news->ID", "Date DESC", "", $num) : false
return ($ChildGalleries) ;
}
function init() {
parent::init();
Requirements::css("gallery/css/Gallery.css");
}
}
template
<div id="ImageGalleryFolder"><ul>
<% control ChildGalleries %>
<li><a href="$Link" alt="$Parent.Title">
<% if CurrentGalleryItems %>
<% control GalleryItems(1) %>
<img src="$ThumbnailURL" alt="$Parent.Title" title="$Parent.Title" />
<br>$Parent.MenuTitle
<% end_control %>
<% end_if %>
</a> </li>
<% end_control %>
</ul></div>