Sort by Title
-
Hi, guys!
On my forum I'm work on category with tutorials for users, it's looks like a guides library.
By default in a category the topics sort by last reply, this is good for discussion topics and not good for category with topics where need step-by-step repeat action.
For example, we have 10 topic with name:
1.1 Guide Moto - Bla Bla Bla for step one 1.2 Guide Moto - Bla Bla Bla for step two 1.3 Guide Moto - Bla Bla Bla for step three Step 1. Bla Bla Bla. One. Step 2. Bla Bla Bla. Two. Step 3. Bla Bla Bla. Three. Bentley 1. Bla Bla Bla. One. Bentley 2. Bla Bla Bla. Two. Bentley 3. Bla Bla Bla. Three.
Users must see the topics in order as above, but we get a chaose in category when users start a replies, ask questions etc...
Step 2. Bla Bla Bla. Two. Bentley 3. Bla Bla Bla. Three. 1.1 Guide Moto - Bla Bla Bla for step one Step 3. Bla Bla Bla. Three. 1.2 Guide Moto - Bla Bla Bla for step two Bentley 2. Bla Bla Bla. Two. Step 1. Bla Bla Bla. One. 1.3 Guide Moto - Bla Bla Bla for step three Bentley 3. Bla Bla Bla. Three.
I found this plugin https://github.com/yariplus/nodebb-plugin-category-sort-by-title, but he is not compotable with 3.x NodeBB.
-
@brazzerstop A temporary solution is to pin all topics in a category, then you can hover over the topic to move it up/down and it stays that way for everyone.
I don't know if it's also in Harmoni, I didn't check. But in Persona it's like that. -
@brazzerstop I don't know
-
@brazzerstop are you looking to have them sorted alphabetically?
-
@brazzerstop can you share link to your forum so I can get idea of format and number of posts?
I think can write widget to read all posts, and re-order them.
I did a small test of this, with the idea that just admin has access to view widget, with click to sort button.Technical thoughts:
What is possible is to read all topicd or posts with write API, e.g.
https://community.nodebb.org/api/v3/posts/{pid}
delete them, sort, then rewrite
But its not best method because new post ids are made.
I have been wondering whether a bubble sort routine working directly on the database post number field might work. Saves re-writing records, only swapping that field.
Up till now Ive never managed to get direct Mongo API calls working.
The NodeBB API however is quite easy to use