Collection re-ordering

Our collections are composed by year, but are not arranging alphabetically/numerically when we would like them to. For example, the collections are currently ordered: "Class of 2012", "Class of 2009", "Class of 2011", "Class of 2010", because that was the order in which they were created. Is there a way to arrange the collections by year so they are not all jumbled up?

You can add ?sort_field=name to the collections browse URL to get them output in alphabetical order.

You could make that change to the URL used in the navigation if you always want that order.

Ok, can you tell me where/what the collections browse URL is? I have our index file open and don't see anything relating to a collections browse URL (sorry, someone else set up all of the backend code, and I'm not very savvy with the site yet).

I see that the ?sort_field=name is being applied to the collection URL when I am editing the collections, but this is not reflected on the actual site - is there a way to permanently reorder the collections and make it so that any added collections down the line fall into that order?

You'll find the link to collections/browse in the the public_nav_main function that is found in header.php file for your theme.


In some themes you'll find a header file in the theme directory: /themes/themename/common/header.php

For most themes, you'll need to create a new /common folder within the theme and and move the header.php file found in application/views/scripts/common/ into that newly-created /common folder in your theme so that the path looks like this: (

The other, easiest options is to handle this when you are logged into the /admin. Go to settings -> themes and configure the "Custom Header Navigation" field. See the directions below:

I am also having trouble finding this function in my header.php file in the common folder. I have the dark theme and I had to move the header file over from application/views. But I am not finding the public_nav_main function in my header.php file? Might it be elsewhere in one of the other php files in views? I do have this though: echo custom_public_nav_header()
I'm not sure if that is the same thing.

Also when you say collections/browse URL are you talking abou this?


Okay, I found it once again in the functions.php file in the application folder. I'm not sure if this is because I'm using Omeka 1.5?. It was called custom_public_nav_header()

I added the string to the uri so it looks like this:

} else {
        $navArray = array(__('About')=>uri('about'), __('Browse Items') => uri('items'), __('Collections') =>uri('collections?sort_field=name'), __('Exhibits') =>uri('exhibits'));
        return public_nav_main($navArray);

And it works.. Hope this is right.

I was able to use the sort field=name parameter ( to sort my browse items page by Dublin Core title, but I would like to be able to sort by collection. Since this is not a DC field, I'm unsure how to do so.

This might or might not be tricky.

The non-tricky version is that this can be done by adding ?sort_field=collection_id to the query.

You can change the direction by adding &sort_dir=a or &sort_dir=d for ascending or descending.

The tricky part is that this sorts by the id of the collection, not it's title. That might or might not be the desired effect

Thanks Patrick! Fortunately, we had uploaded our collections in alphabetical order, so the id #s are in the proper order. That parameter will work well for now.

Unfortunately, we are preparing to add some additional collections, so those will not fall into the correct order. Let me know if you can think of a way to call the collection name instead.

I spoke too soon, and have a follow up. I added the sort parameter to the link to the item browse page in the header navigation. When you go to the item show page by clicking the header tab, it works. But, if you click on the 'Browse all' tab within the item browse page, it reverts, since that link is separate from the header navigation?

Because we are using the geolocation plugin, that secondary navigation is called using <?php echo custom_nav_items(); ?> So I am not sure where to also append the link in the secondary navigation.

You could also try something like this if you need more control over the order:


Is there any possibility for users to re-order their collections? I see we can re-order the items within the collections, but we want to put our five collections in chronological order. Is this possible?

Thank you!

Is this still the best option for setting the default order of collections in alpha order? Thanks!

At least for the browse collections page, the quickest way to do that is to go to the Appearance -> Navigation page and create a new 'Browse Collections' link.

Copy the settings for the default browse collections link into a new link. But, in addition to the default link, add ?sort_dir=a&sort_field=Dublin Core,Title to the end.

If you need to reorder collections elsewhere, that would likely require a plugin, depending on the details of what you need.

Thanks you! I tried to create the new link as described. I copied the link for the default browse collections link and added the code you provided to the end (thanks for that!) to create the new link. But when I try to save the new link, I received the following error messages:

"The navigation settings were not saved because of missing or invalid values. All changed values have been restored."

"Invalid URI for "Browse Collections" navigation link: "/collections/browse?sort_dir=a&sort_field=Dublin Core,Title"

I also tried adding the main site url to the new link to see if that would resolve the error, but it didn't do the trick.

The urls it likes is a bit finicky. I'm guessing that you're missing the first part of the url, something before "/collections".

Double check on the original, default "Browse Collections" navigation link if there is something before "/collections", like "/XXXXXXX/collections/browse". Often, it will be the directory where Omeka is installed. Those structures need to line up exactly.

Sorry - I'm still experiencing this issue. None of the auto-generated links include the main site url before the slug. For example, there is nothing before "collection/browse": "/XXXXXXX/collections/browse" And the auto-generated "About" page link is "/about"

I tried going to the public page and using that link with the slug you provided added to the end, but I'm still getting the same error messages.

Any other ideas?!

Could you post exactly what you have in the link field for the navigation, and if the site is public the url you are using?

We've made the site temporarily public. The main url is:

This is the link I'm using to try and duplicate and sort the collections:

/collections/browse?sort_dir=a&sort_field=Dublin Core,Title

Thanks so much for all your help!

I believe the problem here is that you need to URL-encode the space in "Dublin Core":


Yes! Success!! Thanks so much for all your help as always. It looks perfect:,Title