Default sort by Dublin Core Date field

It is incredibly frustrating to find that I cannot set ITEMS to sort chronologically by Dublin Core Date Field. A "sort by date" option is available on all archiving programs I have used in the past. Omeka should not be the exception.

There's a work around. I've added the following to my theme's items/browse.php file:

<?php $sortdir=$_GET['sort_dir'];
$sortfield=$_GET['sort_field'];
if($sortfield=='Dublin Core,Date'){
if($sortdir=='d'){
$sortby='Sort by Date (Oldest First)';}
else if($sortdir=='a'||empty($sortdir)){
$sortby='Sort by Date (Newest First)';}
}
else{
$sortby='Sort by Date (Oldest First)';
}
$browseHeadings[$sortby] = 'Dublin Core,Date';
echo browse_headings($browseHeadings); ?>

Just figure out where you want to place it, I have it above the pagination links. It toggles between oldest and newest depending on how you currently have it sorted. Also make sure you have the dates in the format YYYY-MM-DD.

OK, editing omeka/admin/themes/default/items/browse.php let me add this button to the administrator interface for browsing items, but what file do I need to edit to add this to the public interface for browsing items?

Oh, nevermind, it's omeka/application/views/scripts/items/browse.php

The file is the browse.php file in the 'items' folder of the theme you are using.

If there is not an /items/browse.php file in the theme that you are using, you can copy the browse.php file from /application/views/scripts/items/ into the /items folder in your theme (create that folder if it doesn't exist at all).

Then make the modifications in the new browse.php that you just copied over.