Skip to content

NodeBB Plugins

Discussion regarding NodeBB Plugin development.

1.8k Topics 15.0k Posts
Most Voted Plugins

Subcategories


  • Have a question about building a plugin? Ask here
    427 Topics
    2k Posts
    traarrrT

    Hi all,
    Well this is my first time writing a plugin which involves using client side hooks...
    For a start, i would want my plugin to listen to a hook which activates when the topic page is completely loaded and topic tools are loaded too.

    For which I wrote this function:

    'use strict'; /* globals document, $ */ $(document).ready(function () { function alertType(type, message) { require(['alerts'], function (alerts) { alerts[type](message); }); } console.log('nodebb-plugin-quickstart: loaded'); $(window).on('action:topic.loaded', notifyBox); function notifyBox() { console.log("in notify box"); alertType('success', "done") } });

    but this is not working... I can only see "nodebb-plugin-quickstart: loaded" on the console.

    Where am i going wrong here??

  • Need a plugin developed? Ask here!
    222 Topics
    1k Posts
    B

    @baris 👍

  • how to delete data when plugin is disabled

    4
    0 Votes
    4 Posts
    2k Views
    yariplusY

    Make sure you have a good reason for doing this. Someone may remove a plugin and reinstall it at a later date, and still want their old settings. Right now this is how it works by default.

  • Create custom route in plugin

    2
    0 Votes
    2 Posts
    3k Views
    yariplusY

    You define routes in your load hook. So your library.js might look like this:

    var Plugin = module.exports = {}; Plugin.load = function (params, callback) { var router = params.router; var middleware = params.middleware; // Define the function that renders the custom route. function render(req, res, next) { // Get whatever data you want to send to the template here. var data = {whatever: 33}; // This is the path to your template without the .tpl, relative to the templates directory in plugin.json var template = 'templatename' // Send the page to the user. res.render(template, data); } // This actually creates the routes, you need two routes for every page. // The first parameter is the actual path to your page. router.get('/yourpage', middleware.buildHeader, render); router.get('/api/yourpage', render); callback(); };

    And your plugin.json would look something like this:

    { "library": "library.js", "hooks": [ { "hook": "static:app.load", "method": "load" } ], "templates": "./public/templates", "staticDirs": { "public": "public" } }

    and you would have a template here:
    /nodebb-plugin-yourplugin/public/templates/templatename.tpl

    <h2>My Awesome Custom Page</h2> The Magic Number is: {whatever}

    I'm pretty sure I posted about this before, with more details even. Have to start using those canned responses. 🌹

  • 1 Votes
    3 Posts
    2k Views
    S

    Has anyone looked at this plugin recently? Is it still working or being supported? Would love to be using it.

  • Plugin for jsbin embed or jsfiddle embed ?

    7
    0 Votes
    7 Posts
    3k Views
    agusputraA

    I have update the repo and add support for jsBin : https://github.com/agusputra/nodebb-plugin-jsfiddle

    Screenshot:
    0_1453628768590_screencapture-yukoding-xyz-topic-19-test-jsfiddle-jsbin-embed-1453626915797.png

  • 0 Votes
    2 Posts
    1k Views
    A

    I believe there are widgets for each of those!

    However, I'd implore you to consider information density- Most users are scared off by even too many categories- putting all that on the landing page will bounce a lot of users!

  • 0 Votes
    6 Posts
    2k Views
    R

    I may have found it. node_modules/nodebb-plugin-google-analytics/lib/client.js looks promising. But ohhzzmyyygeez wtf. I don't know how all of that constructs the js call for GA.

  • Changetip Plugin

    1
    0 Votes
    1 Posts
    933 Views
    orweinbergerO

    Re: Plugin Request: ChangeTip

    This is quite an old request, ChangeTip now has a nodejs module to perform API actions:

    Link Preview Image changetip

    ChangeTip API for NodeJS. Latest version: 0.1.2, last published: 9 years ago. Start using changetip in your project by running `npm i changetip`. There are no other projects in the npm registry using changetip.

    favicon

    npm (www.npmjs.com)

    If anyone can assist with this, it would be very much appreciated.

    I would love to know if anyone has any idea on a different plugin that I could use as a skeleton to create this plugin. I tried using the nodebb-plugin-sso skeleton but it seems to be a bit obsolete.

    Thanks

  • 0 Votes
    2 Posts
    1k Views
    yariplusY

    This is because the form element doesn't exist when you initially load the page.

    Use the event selector on the body element to grab the form dynamically.

    $('body').on('input', '#email', function() { console.log("IN"); $.ajax({ url:'....', data: { 'email_input': $(this).val() }, success: function(data) { } }); });
  • How to create topic from plugin?

    Solved
    3
    0 Votes
    3 Posts
    2k Views
    olegO

    @yariplus yeah, its work, thank you 👍

  • This topic is deleted!

    1
    0 Votes
    1 Posts
    15 Views
  • 0 Votes
    1 Posts
    680 Views
    D

    Hello thanks for any help what I am looking to do is create a plugin that for a category could replace the composer with a "form". what I want is for users to only be able to post a small bit of text say around 100 chars. and then a link to a blog post. Any help in pointing in at what hooks I need would be amazing

    Thank you
    Dale

  • [nodebb-plugin-spoilers] Spoiler text in posts

    34
    3 Votes
    34 Posts
    18k Views
    A

    @AOKP Yup, ended up going with it. The change in syntax is irritating though.

  • 2 Votes
    58 Posts
    26k Views
    julianJ

    @frissdiegurke updated. What about the up key in chat modal? 😄

  • 0 Votes
    4 Posts
    3k Views
    yariplusY

    what is the value of uid

  • 0 Votes
    10 Posts
    4k Views
    julianJ

    Ooh, @yariplus @frissdiegurke I hadn't really thought of that, but yes, that'd work really well to enhance/load behaviour only if a peer is loaded...

    ... and only because peer dependencies are such crap on npm.. 😠

  • 1 Votes
    1 Posts
    1k Views
    J

    Is there any built in extensibility to the NodeBB composer that would allow you to submit additional data along with a submitted topic or post?

    So for example, say you want the users to submit some data to describe their post in a way that is useful for your system, is there a built in extension point that would allow you to add a field (text, select, whatever) to the composer and have that data stored alongside the post?

    I was able to achieve something like this by hacking the extended data by using tags that are automatically created when the user fills in my custom fields. It works for this scenario, but it would be great if there was a better way to do this.

    In addition to being able to add custom data to posts, it would be great if you could specify that the custom extended fields only apply to some categories in your system.

  • Custom plugin, send login error.

    1
    0 Votes
    1 Posts
    678 Views
    W

    Hello, I made a custom LDAP login and was wondering if there was a way to send back a custom error to the login form. My LDAP plugin requires users to login with their username not email and even though it asks for a username people still like to add their email.. At the moment i am just sending back the standard error (username and or password are not correct).

    Is there a way to send back a custom error that will appear in red in the log in page when they attempt to sign in with there email? On a side note, shouldnt nodebb block emails entries (in the form validation) if login is set to username?

    Thanks,

  • Wordpress + WHMCS + NodeBB SSO

    2
    0 Votes
    2 Posts
    2k Views
    C

    I would really appreciate clarity on this. Thank you.

  • 0 Votes
    7 Posts
    4k Views
    D

    Thanks, I do understand how i18n works for plugins. I should have asked if there is a way to do this without having to fork or modify the existing plugin. It seems like the answer is no.

    Personally, I think this is a lacking feature of NodeBB.

  • 7 Votes
    4 Posts
    3k Views
    ?

    Want this for Redis caugh