I have changed the LatestPages function a bit to accomplish a part of my needs.
I can now see the children pages on the sidebar when I'm on the parent page, although when I switch to one of the children, the data on the sidebar is gone.
this is the code I have:
function LatestPages($amount) {
if($amount == null) { $amount = 3; }
$pages = DataObject::get('SiteTree', 'ParentID = '.$this->ID, '`LastEdited` DESC', ' ', $amount);
$return = new DataObjectSet();
foreach($pages as $page) {
$versioned = Versioned::get_version("SiteTree", $page->ID, $page->Version);
$author = Member::get_one("Member", "ID = " . (int)$versioned->AuthorID);
$parent = Member::get_one('SiteTree', $page->ParentID);
$return->push(new ArrayData(array('Page' => $versioned, 'Author' => $author, 'Parent' => $parent)));
}
return $return;
}
I'm not yet familiar with implementing a module in the CMS to select pages that should be shown in the sidebar, maybe this would be a much better and easier approach.
Cheers, Dre