How create a new way to order post
-
-
@pichalite thank to your suggest it works I have only topics that aren't "Pin". If I do this:
The topics show in this way:
In the image I can see that "primo creato " topic that I have PIN it's the last but I want to become the first.I want that when I PIN a topic, this must be the first among the topics (now it is the last).
In plugin.json I put this hook:
{
"hook": "filter:category.topics.prepare", "method": "ordina_zero"
}and in library I do this:
converter.ordina_zero = function(data, callback) { //Prendo quale element del sorted ha cliccato user.getSettings(data['uid'], function(err, settings) { if (settings.categoryTopicSort === 'zero') { data.reverse = false; data.set = 'cid:' + data.cid + ':tids:posts'; } callback(null, data); }); };
My purpose is show the PIN topic at the beginning and after show the topics with their order. Can you help me?
Copyright © 2024 NodeBB | Contributors