Change default sort in Admin Interface

Hey everyone,

I’m currently working on configuring someone’s Omeka-S project and they need to sort their Items(And medias) by Title instead of the default sort by date in the Admin Interface. I know that the search button can be used on top but for their usage, they need the default sort to sort by Title in the Admin Interface.
I tried looking for a setting somewhere but I’m having no luck with that. I also tried looking somewhere in the code but I can’t find anything.
If anybody has a solution, I would truly be grateful to them.

Thanks! :slight_smile:

I don’t think there is currently a setting that will let you pick the default but they are established in the relevant controller. So, for Items if you look in Controller/Admin/ItemController.php and find the browseAction(), the first thing is usually the browse defaults. It will be something like
$this->setBrowseDefaluts('whatever_the_default_is').

You just need to change that string.

To set it to something else, just look at what the values are mapped as. You can find that by going to the view (view/omeka/admin/item/browse.phtml for Items) and look for an array called $sortHeadings. Find the value that corresponds to the default you want, and replace the current default in the controller with that string.

Same goes for any page that displays results like that I think. Hope that helps.