I am having trouble getting the children of a Parent.Parent
The structure of the site is as follows.
TOP LEVEL -> has one 'PlayerSites' -> has many -> 'PlayerSite' -> has one -> 'NewsHolder -> has many 'NewsPage'
So on the 'PlayerSite' page I am getting all the 'NewsPage' items displayed in a list using this function in PlayerSite.PHP
public function PlayerVidNews() {
$playervidnews = DataObject::get_one("PlayerSite");
return ($playervidnews) ? DataObject::get("NewsHolder", "ParentID=" . $this->ID, "") : false;
}
..and then
<% control PlayerVidNews %>
<% control Children %>
<% end_control %>
<% end_control %>
What I want to do is click on one of the 'NewsPage' items from 'PlayerSite' page, which goes to a 'NewsPage' page. On this 'NewsPage' page I also want to display a list of all the other 'NewsPage' items that belong to that particular 'PlayerSite'. However I cant seem to get just those 'NewsPage' items that belong to that particular 'Playersite'.
I have tried putting the same function in NewsPage.PHP And NewsHolder.PHP. But this returns nothing or all 'NewsPage' items, regardless of which 'PlayerSite' they belong to.
public function PlayerVidNews() {
$playervidnews = DataObject::get_one("PlayerSite");
return ($playervidnews) ? DataObject::get("NewsHolder", "ParentID=" . $this->ID, "") : false;
}
... can anyone advise how i might get just those 'NewsPage' items that belong to that particular 'PlayerSite'