Sort topics (within category) in alphabetical order by default

I know that the issue has been discussed before and some progress has been made (and that many disagree that alphabetic sorting on topic title is useful), but to me it is. I am experimenting with Discourse to see if I can use it to replace NeuroDSS.com which contains neurosurgical classification and grading systems. The option that users can add their own classifications (and more) and discuss them on site is a great side benefit. Primarily however, I want users to go to categories easily and find the content they are looking for.

I managed to get the categories view first when accessing NeuroMind.cc, and modified @samā€™s Minimal Topic List Design to allow the user to sort topics in alphabetical order by changing this piece in the header :

<script type='text/x-handlebars' data-template-name='topic-list-header.raw'>
    {{raw "topic-list-header-column" sortable='true' order='topic.title' name='topic.title'}}

This works, but the user still has to perform the sorting manually. How can this be done as a default setting when the category is opened?

Side note: I also changed

{{raw "topic-list-header-column" sortable='true' number='true' order='replies' forceName='Replies'}}

(in the original post it said order='posts' and it gave some side effects, guess that is a typo)

Any help would be greatly appreciated!

Pieter

6 Likes

I think if you ā€œneedā€ to sort by title there is something wrong with your approach. As in, you should be using categories or tags for that information rather than embedding it in the title as a string.

1 Like

That depends, I guessā€¦ If someone wants to ā€œbrowseā€ through a certain category it may be helpful if the content is sorted. Otherwise a topic may be at a different position everytime.

I realize this is not the main purpose of Discourse, but to me the lack of it is currently holding me back of proceeding. Fortunately you also offer categories as JSON in which I can do sorting to create some mobile version myself, but I prefer not to. :wink:

3 Likes

It would probably be easy enough to sort by title except for one problem - endless scroll.

So do an alpha sort in batches of 30?

Wouldnā€™t it be better to use Search?

2 Likes

Dependsā€¦ for very large categories, yes. But if a specific category is restricted regarding adding new content, no.

1 Like

We have a category explaining terms; a dictionary. Here alphabetic sorting would be handy to quickly scroll to the right term.
Why is endless scrolling a problemā€¦? Couldnā€™t you just start with ā€˜Aā€™ and load ā€˜Bā€™ as the user scrolls down?

Or is the problem that the list canā€™t be made because to the browser not all topics are known yet, before the user scroll down?

4 Likes

I think using Tags would be the far easier way to present alphabetically grouped lists, else The Search feature.

1 Like

It looks like this idea isnā€™t going to happen but just to share my use case - we have voting enabled for topics & want to enable users to vote for the stocks that theyā€™d like us to add to our service so that they can invest in them (weā€™re a stockbroker).

The names of each topic within the dedicated category is the name of the stock.

Unless Iā€™m missing something, it seems like the most useful way to order the list, within the category view, would be in alphabetical order, to make finding stocks that others have already requested easier.

I donā€™t think Tags would be right for this, as weā€™d only use each Tag once - one Tag for each of the stocks. And as we all know, a large proportion of users donā€™t use search.

5 Likes

My use case: One of the categories in my Discourse is a User Guide for a website. In the User Guide category I have Topics like ā€œAboutā€, ā€œGetting Startedā€, ā€œSearchingā€, etc. These Topics should be ordered in a specific way, rather than by last update or some other metric. If I could sort the Topics alphabetically, I could rename them to ā€œ1. Aboutā€, ā€œ2. Getting Startedā€, etc.

6 Likes

Can we please have this already? There have been a lot of requests with various usages explained that affect people. I understand the whole philosophy of encouraging good practices, but this has had at least 4 topics Iā€™m aware of and plenty of replies requesting it ā€¦ arguing that weā€™re doing it wrong is kind of telling us weā€™re all stupid at this point :slight_smile:

At least please allow it with query strings in the url (?sort=title) so you donā€™t waste time on GUI extras, but please donā€™t oppose it to the point of almost preventing it.

I donā€™t need it by default. I just want to be able to do it.

In my case, we add integers to post titles as a ā€œrankā€, which we change over time as we review the topicā€™s importance and add new topics. Integers are not necessarily consecutive and their value matters too. Itā€™s a private forum where each topic is a piece of (important) info, from which we need to pick the best N as a last step. The rank reviewing process requires seeing all of them in in one page, and also seeing the integer, then resort, review again, and so on, as we keep working and adding topics with various ranks in-between existing ranks.

We canā€™t use tags or other ugly categorization, because that would remove a subset of titles from view. Search doesnā€™t help either.

Currently we copy paste the titles into excel and do the whole thing there, then come back and re-edit, etc ā€¦ which is stupid. Discourse should have sorting by title. Itā€™s pretty basic.

p.p.s. So far I know of

5 Likes

So we needed another topic about this? If you feel so strongly about it, offer a bounty in marketplace, or sign up for an enterprise hosting plan at discourse.org

1 Like