Skip to content

Plugin Development

Have a question about building a plugin? Ask here
424 Topics 1.9k Posts
  • Hosted Plugins

    9
    0 Votes
    9 Posts
    3k Views
    snodejokeS

    @julian Sorry, hadn't seen that you hadn't got a private npm account to play around with!

    @psychobunny That's a really good idea, it's actually how I've been testing separate projects that use my privately hosted modules currently, before publishing the updates to the npm account.

    It would be great if support came out the box at some point though 🙂

  • Strange encoding issue

    8
    0 Votes
    8 Posts
    3k Views
    hekH

    Yepp.. I convert it back after parsing manipulating the url.

  • Client actions for posts

    5
    0 Votes
    5 Posts
    3k Views
    R

    @pitaj
    Boy, that was quick! Thanks 🙂

  • API: Groups

    Solved
    6
    0 Votes
    6 Posts
    3k Views
    N

    Created a small plugin, to have access to all groups - https://community.nodebb.org/topic/4591/nodebb-plugin-ns-api-ns-api-extended

  • External Login to NodeBB

    2
    0 Votes
    2 Posts
    3k Views
    N

    Ok, question is closed 😉
    I have created plugin for my needs

  • Changing outbound urls

    8
    0 Votes
    8 Posts
    3k Views
    JenklerJ

    Now it works! @psychobunny plz check it out and do a code review if you have the time 😉

  • Extending routes into the write api plugin

    3
    0 Votes
    3 Posts
    2k Views
    snodejokeS

    Thanks a lot. This should save me loads of time! 🙂

  • Navigation Header

    6
    0 Votes
    6 Posts
    3k Views
    P

    Hmm. That might make sense, maybe on plugin activate it appends to end and on deactivate it removes it

  • Trying to use the "action:connected" hook

    17
    0 Votes
    17 Posts
    6k Views
    P

    That's in my area, PM me details maybe I'll come swing by

  • Can't find constants in meta.config

    4
    0 Votes
    4 Posts
    2k Views
    julianJ

    meta.config contains settings from NodeBB itself. Plugins retrieve their own settings via the settings module on the client side.

    In the case of quickstart, you can retrieve the settings the same way the settings are retrieved in the plugin's ACP page, with Settings.load

  • ACP: JavaScript

    21
    0 Votes
    21 Posts
    10k Views
    julianJ

    @pichalite try this 😄

    Link Preview Image Dropbox error - 'echo 100000 | sudo tee / proc/sys/fs/inotify/max_user_watches'

    Dropbox gives me an error that mentions echo tee 100000 but then it disappears. How to fix or remove msg?

    favicon

    Ask Ubuntu (askubuntu.com)

  • Load clientside script depending on route

    4
    0 Votes
    4 Posts
    2k Views
    ExclE

    See: https://github.com/kurt-stolle/nodebb-plugin-exclserver/blob/master/templates/exclserver/servers.tpl

    Why does the <script> tag sometimes not load after rendering the page?

  • Overriding local login

    1
    1 Votes
    1 Posts
    1k Views
    R

    Hello,

    How to use action:auth.overrideLogin hook? what arguments are needed (or at least where to find such information)?
    Assume we have function magic() which performs authentication. How would the rest of code look like? How to obtain credentials?

    Any help highly appreciated 🙂

  • Upload API

    1
    0 Votes
    1 Posts
    1k Views
    N

    I will need upload functional in future plugin.
    Is there any Upload API already in NodeBB ready for plugins use?
    I would like to use ready to use solution, if any, before I will do it myself 😉

  • 0 Votes
    5 Posts
    3k Views
    N

    My case is to provide text-area for the user in ACP, so user for example can "change template" of rendering list item.

    For example one possible solution:

    Store template markup in settings, and ask user to reload NodeBB. In static:load use file system instruments to rewrite template.

    But I'm not happy with such solution 😉

  • Alter Profile with a Plugin

    2
    0 Votes
    2 Posts
    2k Views
    N

    Good news, that we don't need to add filter, there is filter for user profile: filter:user.account
    But what is about static template?

  • JS Minification

    2
    0 Votes
    2 Posts
    2k Views
    N

    Same problem again...

    Actions that I have made to 'fix' this problem:

    Disable single plugin ./nodebb reset plugin="nodebb-widget-essentials" - No Success Disable all plugins - No Success Drop all collections in Mongo, and ./nodebb setup - No Success Delete nodebb.min.js from public directory - No Success Delete all public subdirectories that could be found in .gitignore - No Success Delete public directory and checkout latest from current branch - Success

    Maybe it will give you some insights 😉

  • Get UID

    3
    0 Votes
    3 Posts
    2k Views
    Moritz FriedrichM

    Inside of the client script... Anyway, I just restarted NodeBB and tried it again, it works fine now 🙂 Thank you!

  • Custom profile fields

    7
    1 Votes
    7 Posts
    3k Views
    N

    @psychobunny is there any option to include plugin client js only for /account/edit endpoint?

    Also, Do you have an ideas, how to augment template for the plugin use - templates/account/edit.tpl? I need add dynamic set of fields to the template, Vanilla's account-edit template is 3 column layout (md:2-5-5), I would like to have (md: 2:4:3:3). Main problem here, that I can't find really abstract approach, solution will be very dependent on Theme... One solution, just replace template on app startup, another option, create set of regexps and try to change template or dom manipulation to get another set of columns. Anyway I'm looking for less dependent solution, so It will not brake with every release of the theme and easily work with another themes

    Taking everything into consideration, I will swap edit.tpl and include client js with a template just as script tag. But maybe you have better ideas 😉

  • Plugin registration

    3
    0 Votes
    3 Posts
    2k Views
    barisB

    That error is caused by the following bit of code in src/plugins.js

    paths = paths.map(function(pluginLib) { var parent = path.dirname(pluginLib); return cached.filter(function(libPath) { return libPath.indexOf(parent) !== -1; }); }).reduce(function(prev, cur) { return prev.concat(cur); });

    If paths is an empty array calling reduce will throw that error. We should add better checks to detect that.