How to apply tag sorts by popularity to topic list? Currently it seems only apply to tag page

Does the tag sorts by popularity option in setting only works in generated tag page?

How can I sort tags for each topic and display them in topic list?

Those 3 tags: Java x 10, JavaScript x 5, C++ x 2,

I’d like to achieve if someone use all those 3 tags in a topic and it can be sorted by popularity when shows under that topic, instead of the original order OP gives them, is this possible?


This is a good point; ordering by popularity of the tags should be respected in the topic itself and in the topic list.

I think maybe this should be true regardless of the site setting. @sam how big of a change would this be?



Any update on this? I’d like to check if it’s a relative small feature to add? Or something I can customize as a short-term solution?


Something that’s crossed my mind is sorting by reverse popularity, so the least common / “most informative” tags come first.

Never actually done it, because this sounds like it has more edge cases than a sword factory.


I do feel tag presence on the topic should be default ordered by tag popularity @sam we should assign this, unless it is super hard.

(Also this code path can be skipped entirely if there’s only one tag on a topic.)


since we trade in tag ids I think we join into the tags table anyway, this should be pretty safe and not add any more queries

@kris.kotlarek can you take this?


Improvement was made with that PR and will be included in the next beta release - FEATURE: respect tags_sort_alphabetically setting when display tags by lis2 · Pull Request #10889 · discourse/discourse · GitHub

Below is an example from Meta when tags are sorted by popularity:

For a short moment I changed that option:

The same order of tags you can see when you enter the topic: