I need to change the default ordering of the articles list in the administrator Articles page. To do this I probably would have to edit the populateState() method in administrator/components/com_content/src/Model/ArticlesModel.php but I'd really like to do this change by overriding...
Does anyone know a way to change the default sorting of the articles table using an override? I want the default sorting to be by 'modified date' and not by 'id' as it currently is.
Thank you!
UPDATE:
It was simpler than I thought. It was not necessary to override the model (although Starky's answer on how to do so remains very useful), but I solved the problem doing an override of the com_content in the administrator template. In the file administrator/templates/atum/html/com_content/articles/default.php I changed this code:
/* // Original code
elseif (strpos($listOrder, 'modified') !== false)
{
$orderingColumn = 'modified';
}
else
{
$orderingColumn = 'created';
}
*/
//My new code
elseif (strpos($listOrder, 'created') !== false)
{
$orderingColumn = 'created';
}
else
{
$orderingColumn = 'modified';
}