Putting sort on public browse page

Hi all,

I am trying to add Sort functionality to the public items browse page via the link_to_browse_items function. I am using it like this:

<?php echo link_to_browse_items('[A-Z]', array('sort_field' => 'Dublin Core,Title'), array('sort_dir' => 'a')); ?>

and

<?php echo link_to_browse_items('[Z-A]', array('sort_field' => 'Dublin Core,Title'), array('sort_dir' => 'd')); ?>

The ascending sort works great, but the descending doesn't. Am I specifying the 'sort_dir' param correctly?

Thanks,

Dee

What you want to do is combine your sort_field and sort_dir parameters into the same array:

<?php echo link_to_browse_items('[Z-A]', array('sort_field' => 'Dublin Core,Title', 'sort_dir' => 'd')); ?>

The same applies for the ascending version, but the default sort order is ascending, so the incorrectly separated arrays don't make a difference.

Works great - Thank you very much John Flatness!