Using the taxonomy module, if I specify a URL of www.example.com/taxonomy/term/1+2+3, the terms 1, 2 & 3 seem to appear in a random order at the top of the URL. Is there a way to specify the order in which the terms appear?

Comments

Jaza’s picture

I assume that you are referring to the order in which the term names appear in the title of the page. The short answer to your question is, no, not really.

The query in the taxonomy module that produces the list of names, retrieves them from the database without specifying any order. This means that the database returns the names in the order that they're physically stored on the disk, which is generally the order in which the terms were created (from oldest to newest). 'Physical' order is essentially random, because the order in which you created the terms does not necessarily indicate... well... anything!

You could change this behaviour, by adding an 'ORDER BY' clause to the SQL in the taxonomy_term_page() function. But that would be a hack, and hacking your copy of Drupal core is not recommended (makes your life hell when it comes time to upgrade). This lack of an 'ORDER BY' could be considered a bug, in which case you can submit a bug report.

Jeremy Epstein - GreenAsh

Jeremy Epstein - GreenAsh

mfredrickson’s picture

I would agree this is a bug. Specifically, these should be ordered by weight. This setting is there for a reason.