I’m working on a site that deals with animals that are routinely referred to by their latin names.
I want to set up genus and species tags that can be added to topics but I’ll need them to always display in that order even if the species name is lower than the genus name alphabetically.
Is there a way to do that without resorting to adding some sort of character to the beginning of one group or the other?
For example, Theraphosablondi needs to be listed in that order, not alphabetical
It turns out the answer is so much simpler than you’d think, and should probably be in a document for future reference.
I spent all day working trying to get both a theme component and a plugin to work to do what I wanted, with no luck.
Then for fun I looked at the values of ascii characters and settled on some lower values to put in front of my tags. I figured it might be a little ugly but at least I’d have them in the proper order.
Turns out when you use non alphabet characters, they remain with the term, but are not displayed.
So in my Genus tag group, I used the single quote with a value of 39, and in my Species tag group I used a comma with a value of 44.
This makes all Genus terms sort before all Species terms, and then additional tags are all higher since the alphabet starts with a value of 65.
To create a Genus term I type 'Theraphosa and it’s displayed as Theraphosa but it’s displayed before my Species of blondi created as ,blondi, and they both come before an additional tag of terrestrial, even though alphabetically that would be between those two words.
It appears to work perfectly, I didn’t even have to know about the hidden character, I just started typing the hashtag then A-V and the list filtered down for me as normal.
Awesome ingenuity and discovery. Hopefully the team spots this.
However this could maybe added as a supplement to documentation on tags. Maybe in the wiki? There is a documentation project. Main topic introducing it here