Don
8월 27, 2025, 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
18개의 좋아요
Moin
8월 27, 2025, 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 )
8월 27, 2025, 2:35오후
3
this is a great component Don, nice work! thanks for creating this
6개의 좋아요
Don
8월 27, 2025, 2:36오후
4
Sure! PR welcome thanks @Moin
5개의 좋아요
Lilly
(Lillian )
8월 27, 2025, 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
8월 27, 2025, 2:48오후
7
Yeah this is by design — if you click the same item again the sorting direction changes.
5개의 좋아요
Lilly
(Lillian )
8월 27, 2025, 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
4개의 좋아요
Lilly
(Lillian )
8월 27, 2025, 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
8월 27, 2025, 3:29오후
10
4개의 좋아요
Moin
9월 8, 2025, 12:24오후
11
병합되었습니다.
추가 주문 옵션에 대해 제가 선택한 아이콘과 라벨
{
"icon": "custom-heart-circle-one",
"label": "js.category.sort_options.op_likes",
"action": "op_likes"
},
{
"icon": "user-group",
"label": "js.posters",
"action": "posters"
},
{
"icon": "far-square",
"label": "js.category.sort_options.category",
"action": "category"
},
{
"icon": "square-plus",
"label": "js.topic_voting.vote_title_plural",
"action": "votes"
}
이 옵션들이 덜 일반적으로 사용된다고 생각하여 기본 설정에 추가하지 않았습니다. 하지만 이 옵션들을 추가하면, 이제 첫 게시물에 대한 좋아요 수, 게시자 수, 카테고리 ID, 그리고 토픽 투표 플러그인이 사용될 경우 투표 수로도 정렬할 수 있습니다.
모바일에서 라벨이 숨겨져 있을 때도 좋아요와 첫 게시물 좋아요를 구별할 수 있도록 OP(첫 게시물) 좋아요를 위한 아이콘을 만들었습니다.
4개의 좋아요
eisammy
(Sammy)
9월 12, 2025, 2:10오후
13
모바일에서 옵션을 선택하면 DOM이 로드될 때까지 이 모달이 위로 이동합니다.
UI 버그인가요?