[nodebb-plugin-category-sort-by-votes] Sort topics by votes within a category!

  • Nodebb-Plugin-Category-Sort-By-Votes


    NodeBB allows you to sort posts by votes in a topic, but within a category you can't sort topics by votes.

    This plugin allows you to sort topics by votes within a category. See screenshot below, you get a little "Most votes" selection from the "Sort by" dropdown menu.

    As requested here and here. Developed and maintained by @xidui and @wktang.



    • Install it from NodeBB Admin Panel, or

        npm install nodebb-plugin-category-sort-by-votes


    1. Go to the ACP (Admin Control Panel).

    2. Activate plugin and reload NodeBB.

    3. Click Plugins -> Category Sort to go to the Plugin's settings.

    4. Click "Re Index" to index all topics (see below screenshot).


    5. Go to any category, select "Most votes" from the "Sort by" dropdown and it should work!


    Feature of sorting by votes use cid:[cid]:tids:votes as key, while it is not supported by NodeBB. So we must recreate the index to make it work.
    If "reindex" is not applied before you use "Sort By Votes" option in the category page, the category page will be blank.

    We also use action:post.downvote, action:post.unvote, action:post.upvote hook to listen user actions and dynamically update the sortedSet which use cid:[cid]:tids:votes as key.

    GitHub | Bugs & Suggestions

  • Admin



Looks like your connection to NodeBB was lost, please wait while we try to reconnect.