Dear Ron,

I have just updated to the newest dev version and everything seems to work smoothly.

However, I am wondering, wrt. which criterion, the entries are listed when sorted by year.

I would be expecting something like chronological/reverse chronological ordering, but the ordering seems to be rather random?

Can you comment on that?

Thanks,thomas

Comments

rjerome’s picture

I'm not sure what you mean when you say random, I looked at your site and it seems normal to me. The sorting is done by year of publication then by title ascending.

deselaers’s picture

Hi Ron,

OK. Now that you say it, I agree that the sorting is by title. It is just that I had not expected this.
It would be great to be able to sort by Conference date/Journal Publication date, such that the ordering of the publications in the list is reverse chronological, if years are listed 2008, 2007, ...

Can you give me a hint, where the sorting is done, I might try to do that myself, and if it turns up to be proper code, I will gladly contribute it to you.

Cheers, Thanks
thomas

rjerome’s picture

Yep, line 102 of biblio.pages.inc

      $sortby = "ORDER BY b.biblio_year %s,  SUBSTRING(n.title,1,3) ASC ";

There have been a number of requests to have "user configurable" cascading sorting, and I was planning on implementing this at some point. This would allow the admin to choose which fields (if any) are used for the sub sort.

Ron.

jastern’s picture

thanks thomas and ron for this..

in our use case we wanted by year, then secondarily by author name. here's the simple hack for those interested, until 2ndary (sub) sorts are implemented:

in ''biblio.pages.inc'',

    case 'year':
    default:
      $sortby = "ORDER BY b.biblio_year %s, b.biblio_date %s";
  } //end switch

becomes

    case 'year':
    default:
      $sortby = "ORDER BY b.biblio_year %s, bcd.lastname ASC, bcd.firstname ASC ";
      $where['bc-rank'] = "bc.rank=0";
      $where['bc-auth-category'] = "bc.auth_category=1";
      $joins['bc'] = '  JOIN {biblio_contributor} as bc on b.vid = bc.vid ';
      $joins['bcd'] = '  JOIN {biblio_contributor_data} as bcd on bc.cid = bcd.cid ';
  } //end switch
nhck’s picture

Issue tags: +sort, +sorting, +criterions, +biblio type

Sorry to bump this, but this issue doesn't make it clear enough for me.

So far: If one sorts by e.g. "type" it only sorts by this criterion, the others e.g. "author","year" and so on are neglected. As far as I understand this causes a somewhat random sort order on the second criterion depending on what you expect: If you expect it to be sorted by type and expect the second criterion to be year the sort order seems a little odd, because the second criterion seems to be the title by default.

My support question is: Am I doing something wrong here? I would like to sort type->year->title->author?

If the answer is "no" my feature suggestion would be: Changing this in a drag and drop list like we can see for the menu tree? I would implement this if someone could get me some pointers on the drag+drop list, e.g. doc-links? I can't find any.

Thanks :-)

rjerome’s picture

The reason I let this slide is that you can do it fairly easily with Views, and was seriously considering moving the entire query building process to use Views. It seems to be a duplication of effort to recreate a interactive query builder when that's exactly what Views provides.

That being said, I haven't actually done it yet, but it's likely to happen in both the 6.x-2.x and 7.x branches.

Ron.

nhck’s picture

Title: sorting criterion » Using Views as a Sort Handler
Category: support » feature

Hej Ron,

how should I get started on implementing this?

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.