Geolocation Map Plugin - display map item list order by item name instead of ID

Greetings,

We would like to order items in the map list by name. Right now the order defaults to oldest items first (which I assume is by ID ascending)

I don't see a way to change the display order in the admin area.

It looks like I'd need to modify

/Geolocation/models/Table/Location.php

/Geolocation/models/API/Location.php

/Geolocation/controllers/MapController.php

I write custom db queries and modify templates for several CMS systems, so I am not afraid to take a stab at this. Thanks very much.

The "browse the map" page takes the same parameters as the browse page, including those for sorting. Adding ?sort_field=Dublin%20Core,Title to the URL should get you title-based sorting without making any changes.

Hi John,

I would rather do this within the code. A lot of folks nowadays are not comfortable putting a sort query in the URL field. It also speaks to me of security issues. I would be happy to work on adding a 'sort by' setting plus default sort setting to the plugin, and contribute this back to Github. I would be grateful for any starting points. Thanks.

EDIT: I am also following this thread: https://github.com/omeka/Omeka/issues/684#issuecomment-212489228

Is it possible to incorporate this? http://omeka.readthedocs.io/en/latest/Reference/libraries/globals/browse_sort_links.html

browse_sort_links probably won't give what you are looking for, since it's designed to create links to change the sorting, like in the tables on that admin-side items browse.

Adding the parameter to the query wouldn't require users doing anything, though. Under Appearance->Navigation, you could create a new navigation link that reproduces the existing 'Map' link, then just tacks on the parameter John described. Then, just disable the original 'Map' link. Those parameters get cleaned up for security concerns, so there shouldn't be a worry there (though if you notice we've let something slip through in the plugin, we'd of course appreciate the heads up!)

Thank you very much! I will do this.