Choosing display order of types with show.php

Help
2009-01-03
2013-05-28
  • Frederic Goualard

    Hi,

    I am using Refbase 0.9.5. I use show.php to retrieve all the entries of my database and display them on a web page.

    I am currently not happy with the way the results are presented when I use 'citeOrder=type' or 'citeOrder=type-year' as it seems that Refbase sorts types according to their name ('Journal Article', and so on), while I would prefer to sort them according to their perceived 'importance' (e.g., an article in a journal is better than a paper in a conference, and so on).

    How can I choose my own ordering of the types?

    I have taken a look at the SQL tables and it seems that entries in Table 'refs' do not use a key to link to some entry in Table 'types' but use directly the name of the type itself. I have tried to change the names of types (e.g., "Journal Article" becomes "01: Journal Article", 'Abstract" becomes "02: Abstract") but that breaks the code in many other parts, as already stated by Matthias in other threads.

    Any idea?

    Best regards and Happy New Year!

     
    • Matthias Steffens

      Hi Frederic,

      sorry for the late reply.

      > I am currently not happy with the way the results are presented when
      > I use 'citeOrder=type' or 'citeOrder=type-year' as it seems that
      > Refbase sorts types according to their name ('Journal Article', and
      > so on),

      This is correct. For example, in case of 'citeOrder=type', refbase sorts records first by record type and thesis type (in descending order), then in the usual way:

      ... ORDER BY type DESC, thesis DESC, first_author, author_count, author, year, title

      > while I would prefer to sort them according to their perceived
      > 'importance' (e.g., an article in a journal is better than a paper
      > in a conference, and so on).

      Yes, I agree that would be much better. I did also think about this previously, but in the past there was always something that was considered more important.

      > How can I choose my own ordering of the types?

      I'll need to look into this in more detail.

      One option might be to add a column (say, 'type_order_by) to table refs (i.e. a per-record value). Keeping the design flat (and not related/normalized) may avoid complex modifications to the underlying SQL patterns. OTOH, this would require code to keep the column value in sync with the 'type' column.

      So a better way might be to add a dedicated column to table 'types', include a JOIN statement in the SQL queries, and use this new column for sorting. However, this may need to wait until we've generalized the creation of the FROM clauses. But I'm really not sure. I'll try to look into this.

      Matthias

       
    • Frederic Goualard

      Ok. Thank you for that, Matthias. Despite my initial remark, I still appreciate the time you take on developing refbase. It's a great tool.

      Best regards,

      F.

       

Log in to post a comment.