I need to add the sorting by latest ID so that i can still open the link and see the full 'Uudis' (News In estonian). But when i control the Uudis using control Uudised it will show all news and order them by id biggest id is the latest so it shows it on the top. Using SS2.4
Uudislist.php
class Uudislist_Controller extends Page_Controller
{
function show(){
return array();
}
function Uudis(){
if(isset($this->request) && $this->request->param('ID')){
return DataObject::get_by_id('Uudis', (int)$this->request->param('ID'));
}
}
}
Uudis.php
function Link(){
return $this->Uudislist()->Link() .'show/'.$this->ID;
}