UCSCLibrary / ucsc-library-digital-collections

A rails app based on Hyrax to be used as a repository for UCSC library digital collections.
1 stars 2 forks source link

modify url to sort works in a collection by title #662

Closed snehagunduraoUL closed 1 year ago

snehagunduraoUL commented 1 year ago

resolves #642

rschwab commented 1 year ago

I see a couple potential issues with this solution:

  1. It will change it for every collection on the A-Z page, I think only Aerials is supposed to be sorted in this way.
  2. It will only change it when you visit from the A-Z link, and not if you find it another way for example a LibGuide.

If you use the collection controller before_action you can customize the sort using the blacklight configuration object, and make it only happen on the aerials when there's no query (we want relevance to become the default again after a search is done). See: https://workshop.projectblacklight.org/v7.11.1/sort_fields/ And: https://github.com/UCSCLibrary/ucsc-library-digital-collections/blob/08c55c87d6030f133522224b64ce70f72f0f2935/app/controllers/collections_controller.rb#L13