[nodebb-plugin-topic-badges] Topic Badges

NodeBB Plugins
  • Whats happend with user badges?

  • I believe most future plugins have been considered, however, have been deferred due to a somewhat massive overhaul and stabilization of the entire application which is totally understandable since its still in its early stages.

    After all of the necessary refactoring and when 0.4.0 is released you might see more plugins.

    So in all essence, what I am saying is patience my dear friend. 😈

  • Is it compatible with 0.4x ?

  • Thanks for the reminder, no its not - it crashes when I "mark as solved" (everything else works). Will get back to you shortly 😛

  • lol. Hope it will come back soon 😉

  • Just released v0.0.7 which should be compatible up to latest 👍

  • This post is deleted!
  • I'm using this plugin on my forums and using this little JS you can add icons to the badges as well:

    <script type="text/javascript">
    $(window).on('action:widgets.loaded', function() {
    	$('.topic-badge').each(function(index, el) {
    		var badgeType = el.textContent;
    		switch (badgeType) {
    				var icon = 'fa-book';
    		if (icon) {
    			$(el).prepend('<span class="fa ' + icon + '"></span> ')


    Screenshot 2014-07-04 11.14.25.png

  • It's a novel idea, but frankly I don't think this needs to be its own thing. I would roll it into tags.

    Reason #1: You get weird URLs
    Example 1: /topic/868/nodebb-plugin-topic-badges-topic-badges/
    Example 2: /topic/1107/nodebb-plugin-google-adsense-google-adsense

    Reason #2: It would fit neatly in with tags
    Here's how it could work: When I start a post with a [, I could be presented with an auto-complete list (a la @mentions) of canonical tags, i.e. tags that will be shown in this top spot, and might have an icon attached to it etc. No extra text would be added to the URL/title, it'd just be added as a tag.

    Reason #3: Tags are more powerful
    I don't really see the point in giving a thread the nodebb-plugin-google-adsense badge unless this badge can be used as a filter to show only threads using this badge. In other words, how tags work.

  • Personally I haven't used this plugin since tags came in, seems a little bit unnecessary having two different ways to specify the same information.

  • @Erlend-Sogge-Heggen I would add to your suggestion the ability to add color to certain tags (admin only). I needed the topic badges for a forum that handles two types of contents (like books and films) and tags weren't enough. Since NodeBB doesn't support sub-categories, I had to rely on this. Using colors (even priorities!) in tags would allow a better sight of the post contents.

  • @fmartingr This is possible through CSS.

    Let's say your users use the tag Book & Film. The URL for these two would be




    Using css selectors, you can do something like this to your custom css:

    a[href="/tags/book"] > span {
    background: red;


    a[href="/tags/film"] > span {
    background: green;

    Replace green/red with #hex codes if you prefer.

    What this does is any tag created, with a href value of film or book will be coloured differently. You can do this for any "official" tags you use. Any others will be the default blue or whatever colour you've changed it to.

    Screenshot for proof


  • @a_5mith I know that it can be done with CSS, as you can add the icons too. But I'd rather prefer an admin interface instead of CSS/JS hacks. Too much of that last months doing a vbulletin setup for a customer.. 😢 But I think is that over multiple label types I suppose.

    Thanks for the remainder.

  • @fmartingr I wouldn't call it a hack, having a background option in the ACP would produce very similar code.

  • @a_5mith But you will have it located into a "tags" admin option instead of merged into other css rules.

  • @fmartingr combining CSS and minifying it is good practice. But it's the individual admins choice how they use their forum. 👍

  • what would be cool is if the badges had a sorta setup, like the solved unsolved look/ui

  • I just updated to 0.7.2 and this plugin is throwing errors at me:

    4/8 06:06 [1752] - error: TypeError: undefined is not a function
        at Object.TopicBadges.addThreadTools [as method] (/opt/nodebb/node_modules/nodebb-plugin-topic-badges/library.js:29:15)
        at /opt/nodebb/src/plugins/hooks.js:89:12
        at /opt/nodebb/node_modules/async/lib/async.js:269:13
        at iterate (/opt/nodebb/node_modules/async/lib/async.js:146:13)
        at Object.async.eachSeries (/opt/nodebb/node_modules/async/lib/async.js:162:9)
        at Object.async.reduce (/opt/nodebb/node_modules/async/lib/async.js:268:15)
        at fireFilterHook (/opt/nodebb/src/plugins/hooks.js:81:9)
        at Plugins.fireHook (/opt/nodebb/src/plugins/hooks.js:62:5)
        at Object.threadTools (/opt/nodebb/node_modules/async/lib/async.js:653:23)
        at /opt/nodebb/node_modules/async/lib/async.js:580:25

    This happens when any topic is loaded with the addon enabled. Control panel reports 0.1.1 installed.

Suggested Topics