Invisible way to force display order of tags?

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, Theraphosa blondi needs to be listed in that order, not alphabetical

Mhh :thinking:

As far as I know you can’t change the order of them per se. They are either sorted by popularity or alphabetically I think.

To create your own order you’d probably need some sort of plugin I’d imagine? You can try developing this yourself or ask in Marketplace

2 Likes

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.

I hope this helps someone else, and I really home someday Discourse will create the plugin I could not.

2 Likes

That is a great workaround. As this question has often come up in the past for different things

Like state then city, car manufacturer and model.

Etc..

One question though. With using the “'” and “,”. I imagine a minor caveat would be it might affect using “#” to put tag say here ie ux ?

This is quite helpful as the alternative was to create numerous long tags.

1 Like

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.

2 Likes

That’s really thinking out the box. Glad you got it working!

1 Like

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