Don
2025 年 8 月 27 日午後 1:52
1
Install this theme component
Hello
This theme component adds a new button next to the Create Topic button, allowing you to change the topic list order. One of the main goals was to make topic ordering easily accessible on mobile devices as well and themes where the topic list header section is hidden.
Clicking on an item will show the sort order direction (ascending or descending) on the right side of the item.
Descending (icon)
Ascending (icon)
Settings
This component contains several settings for customization.
Object setting
With the object setting you can change each item’s icon , label , action and order .
icon → icon name from the Discourse icon set
label → translation key (see /admin/customize/site_texts
)
action → sorting action identifier
order → position of the item in the dropdown
Example for label
:
In this case the label field should be: js.likes
「いいね!」 14
Moin
2025 年 8 月 27 日午後 2:24
2
Great component! I thought about creating something similar.
I noticed you did not add a license to the GitHub repo.
Would you accept a pull request that adds more order options like op_likes
?
SORTABLE_MAPPING = {
"likes" => "like_count",
"op_likes" => "op_likes",
"views" => "views",
"posts" => "posts_count",
"activity" => "bumped_at",
"posters" => "participant_count",
"category" => "category_id",
"created" => "created_at",
「いいね!」 5
Lilly
(Lillian Louis)
2025 年 8 月 27 日午後 2:35
3
this is a great component Don, nice work! thanks for creating this
「いいね!」 4
Don
2025 年 8 月 27 日午後 2:36
4
Sure! PR welcome thanks @Moin
「いいね!」 4
Lilly
(Lillian Louis)
2025 年 8 月 27 日午後 2:42
5
One thing I noted is that I sort of expect the drop down to disappear after I’ve clicked one of the selections. I have to click outside it after the view changes to make it go away. But maybe that is by design - I’m not sure lol.
「いいね!」 3
Don
2025 年 8 月 27 日午後 2:48
7
Yeah this is by design — if you click the same item again the sorting direction changes.
「いいね!」 3
Lilly
(Lillian Louis)
2025 年 8 月 27 日午後 2:49
8
yea i was thinking that after playing with it more. i love this component - very useful for me on my own instance. thanks again
「いいね!」 3
Lilly
(Lillian Louis)
2025 年 8 月 27 日午後 2:54
9
I notice the sort by
button appears on the categories page, but doesn’t do anything there. could probably hide it in that case.
「いいね!」 3
Don
2025 年 8 月 27 日午後 3:29
10
「いいね!」 3