Can i thinktreat catalog as a tag

NodeBB Development
  • the catalog looks like a tag, so is't possible to let a post have multiple catalog?

    for instance a post can tag it with "tv" and "game", then the post can be seen under "tv" catalog, also "game" catalog; or merge these catalog to "tv game"

    if I want to do it, is't possible to do it by write my own plugin? or I have to modify the NodeBB core source code? I would hope not to modify the core source code ~

  • Hey @sam, good to see you again!

    I believe that each topic only has one cid, but I will look into it. I do know that I originally did want to support multiple categories for topics, so we shall see...

  • src/topics.js

    // in future it may be possible to add topics to several categories, so leaving the door open here.
    RDB.zadd('categories:' + category_id + ':tid', timestamp, tid);
    

    I'm not sure how you want to achieve this on the front end, but it would be possible for example to create a "tag" button on the thread view that pops up a modal of the various categories. And when you select those categories it makes an API call that adds the topic ID to the categories:cid:tid set.

    Nothing like this has been done before as far as plugins are concerned so if you feel like developing this please let me know and I can give you a hand if you need it! 🙂

  • Hi @julian, good to see you too!

    Thanks for considering it as a possible feature in the feature, I am looking forward to see it

  • src/topics.js

    // in future it may be possible to add topics to several categories, so leaving the door open here.
    RDB.zadd('categories:' + category_id + ':tid', timestamp, tid);
    

    Hi @psychobunny, thanks for the valuable hint, with it, it's possible to do what I want~

  • Hooray for forward-thinking 🙂

    Initially, we kicked around the idea of supporting multiple categories per topic (so, more like a "tagging" approach, as opposed to categories).

    In the end, we felt that having a "middle-ground" between statically defined categories and user-defined tags was not a proper compromise (since it ended up not being greater than the sum of its parts), so we stuck with static categories.

    A tagging plugin can be built, of course........


Suggested Topics