Hi (again). I have added a dropdown box to my page type "Tour". This Dropdown box contains the site tree. The purpose of it is to link one Tour to another (beacuse the tours are offered in reverse itineraries). This works well, and saves the value of the select Reverse Tour in a field called ReversTourID.
Now I am trying to access this reverse tour and add a link in the template to that page. I have found other threads on this and have added a function to Tour.php (which extends Page)
function GetReverseTour() {
$thisPage = DataObject::get_by_id("Page",$this->ReverseTourID);
return $thisPage;
}
I have also tried replacing "Page" with "Tour", but in debug mode, I get this error when I call the above function:
FATAL ERROR: Object::__call() Method 'forTemplate' not found in class 'Tour'
Any Ideas? Am I out of the DataObject scope here? Isn't page a decendant of SiteTree, and thus DataObject?
Cheers
Aaron