Hi,
I have a DataObject with a list/details page very similar to the regions section in the one Ring lessons, the only thing I’m trying to change is the linking from the ID to the URL Segment
So I changed the link function to:
public function Link(){
//return $this->EventsPage()->Link('details/'. $this->ID);
return $this->EventsPage()->Link('details/'. $this->UrlSegment);
}
And the details function to this
public function details(ss_HTTPRequest $request){
//$event = Event::get()->byID($request->param('ID'));
$event = Event::get()->filter(array('UrlSegment' => $request->param('ID')));
if(!$event) {
return $this->httpError(404, 'That region could not be found');
}
return array (
'Event' => $event,
'Title' => $event->Artist
);
}
If I do a debug I see that all the data is there the only difference is that if you use the get()->byID you will get a Database record, and if you use the get()->filter you get a datalist
Now how do I show the DataList Data in the template? I tried everything but I have no success.