Item browse default setting

Unless I’m missing it, there is no way currently to set the default browse sort order. I remember there was a plugin for it in Omeka Classic.

I checked the Omeka-S settings as well as site settings and theme settings, but didn’t find anything in the UI. Also checked the application files like in /config but didn’t find a setting there.

After some grepping and exploring, I found the setting hardcoded into /application/src/Controller/Site/ItemController.php

    public function browseAction()
    {
        $site = $this->currentSite();

        $this->setBrowseDefaults('dcterms:date');

I was able to successfully modify it.

Is there any way to modify this per site without resorting to a plugin? Perhaps I could add a PHP function within the theme associated with this particular site (not root in my case)? I don’t need it to apply to every site at the moment, and of course I don’t prefer to modify the core application code :slight_smile:

The “typical” method of setting default browse orders in Classic was to just include ordering parameters in the link in the navigation.

At this point I wouldn’t mind just manually hard-coding the change from DESC to ASC! If you can point me to where that query exists?

It’s just a particular of our collection at Edison Papers that the order the items were imported in is meaningful, but in ASC rather than DESC. I suppose I could have reversed the import order but as you know our history and how I’ve migrated the data, it’s not a quick and easy option for the 150k records that are already imported.

Oh, the simple solution (didn’t realize “created” was a special term)… we’ve made our “Browse Documents” navigation item link to the following rather than just /item.

/s/digital/item?&sort_by=created&sort_order=asc

When you use sort_by=created, you avoid the additional overhead of a “custom” or “advanced” search which has to join the “value” table to the item+resource tables in order to generate a sort order.