It would be nice to have several sort criteria applied to a list; for instance, by type, then by author, then by title (see example below). I believe this cascading is the accepted indexing practice of many bibliography list formats. I'm not sure if the person managing the bibliography should configure this, or if it should be contained in the Bibliography Style's profile ... possibly the latter with an option to override.

Books
Jones, Michael. Bride of My Story.
Jones, Michael. My Story.
Smith, Tom. The Smith Family in Ancient Greece

Journals
Quigley, Horace. "The Eternal Quest," Saturday Evening Post.

CommentFileSizeAuthor
#2 sort_problem.jpg94.03 KBklib
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rjerome’s picture

This is being done already, but not as you suggest. When sorted by type, the entries are sub-sorted by year and then title. This is done at the SQL level, since I think it's more efficient than trying to resort the results in PHP when styling them. I would probably be possible to make this admin configurable, I'll think on it a bit.

Ron.

klib’s picture

FileSize
94.03 KB

I would like to second on this. The sorting does not seem to be right for subsorting at all. I click on type, but the titles are still not in the right order. See attached screen shot.

Many thanks,

- Reiling

tobbe_s’s picture

klib, I think this is because the SQL statement only sorts the title (or author in that case) on the first letter:

  switch ($pager_attrib['sort']) {
    case 'type':
      $sortby = "ORDER BY b.biblio_type %s, b.biblio_year DESC, SUBSTRING(n.title,1,1) ASC ";
      break;
    case 'title':
      $sortby = "ORDER BY SUBSTRING(n.title,1,1) %s, b.biblio_year DESC ";
      break;
    case 'author':
      /*$join[] = "inner join {biblio_has_author} as ha on a.aid = ha.aid"; 
      $join[] = "inner join  {biblio_author_index} as a on b.nid= ha.nid";
      $sortby = " ORDER BY a.author %s ";
      $where[] = "ha.rank = 1 ";
      */
      $sortby = "ORDER BY SUBSTRING(LTRIM(b.biblio_authors),1,1) %s, b.biblio_year DESC ";
      break;
    case 'year':
    default:
      $sortby = "ORDER BY b.biblio_year %s, b.biblio_date DESC, SUBSTRING(n.title,1,1) ASC, b.biblio_type ASC ";

Maybe this is done for performance, but I think it should be changed to take more letters in account, if not the entire field.

Cheers,
T

fm’s picture

This is being done already, but not as you suggest. When sorted by type, the entries are sub-sorted by year and then title. This is done at the SQL level, since I think it's more efficient than trying to resort the results in PHP when styling them. I would probably be possible to make this admin configurable, I'll think on it a bit.

Ron.

I can appreciate the efficiency of what you've implemented; however, in this instance efficiency may be getting in the way of correct results.

Imho, it would be preferable to adhere to the formal conventions prescribed for bibliography format in a given field. In the discipline of history, which subscribes to the MLA and Chicago style conventions, a bibliography sorts by author, then by title. Optionally, a sort by publication type may be performed prior to the sort by author. Sorting by date is important only when more than one edition has been published.

I think it may be beneficial to assign different default sorts in within the code for each of the styles (e.g. MLA, APA, CSE, etc.), but also allow the administrator to override the defaults.

rjerome’s picture

This (sorting) and the new styles are next on the list.

Ron.

fm’s picture

It has occurred to me that if Biblio were compatible with the Views module, you wouldn't have to deal with sorts, cascading sorts, or sorts of any kind. You could leave sorting up to the end-users.

Imho, it's still preferable to build an override-able default sort into each academic style (APA, MLA, CSE, etc.), but barring that Views is an attractive alternative.

Anywho, any progress on cascading sorts?

fm’s picture

:-)

Just a friendly reminder.

lenov’s picture

I believe this issue, that is unfortunately more than 5 year old now, is a duplicate of

http://drupal.org/node/1310186

The latter being specific to 6.x, I thought maybe we should revive this one.

This Biblio module is awesome, but the secondary sort by titles is really awkward. I never saw that anywhere else, and it makes reading bibliography really painful. On my own bibliography, I sometimes spend a lot of time looking for an article because my mind has been wired "author alphabetical order" by 20 years of academia.

Liam Morland’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

This version is no longer maintained. If this issue is still relevant to the Drupal 7 version, please re-open and provide details.