Skip to content

Plugin Development

Have a question about building a plugin? Ask here
444 Topics 1.9k Posts
  • Slick Theme - nodebb-plugin-recent-cards text color

    Solved
    4
    0 Votes
    4 Posts
    2k Views
    W
    @pichalite @PitaJ Thanks guys, that worked.
  • cannot load webtorrent in my plugin.

    Solved
    3
    0 Votes
    3 Posts
    2k Views
    F
    @pitaj thank you,it works well.
  • How difficult would it be to add/display an additional user attribute?

    4
    0 Votes
    4 Posts
    2k Views
    W
    @julian There didn't appear to be a way of managing this number plus I assumed there are already lots of things node already does to modify this number. I wanted completely control of it, including the ability to "spend" it on things down the road.
  • Cannot access admin after installing plugin

    3
    0 Votes
    3 Posts
    2k Views
    P
    @pitaj said in Cannot access admin after installing plugin: @panagiotis try running ./nodebb build again Hi @pitaj. Thanks it worked!
  • NodeBB libraries not accessible in plugin?

    6
    0 Votes
    6 Posts
    2k Views
    PitaJP
    Also, just FYI, the docs you used are the old docs, the new ones are at docs.nodebb.org You can open an issue at github.com/nodebb/docs if you wish for a change to be made
  • Style topics differently by category

    3
    0 Votes
    3 Posts
    2k Views
    Brass ManB
    fantastic! my codebase is much happier now
  • [nodebb-plugin-ali-oss] The Server and the OSS is not synchronous

    1
    0 Votes
    1 Posts
    1k Views
    ayiyanA
    [root@bbs nodebb_develop]# tail -n 8 /etc/profile export OSS_ACCESS_KEY_ID="MTBINQ9JTjyY5m" export OSS_SECRET_ACCESS_KEY="Ru87oDgLzgBbBdoCqb0KbGHNRX6ao" export OSS_UPLOADS_HOST="http://nodebbs.oss-cn-shanghai.aliyuncs.com" export OSS_UPLOADS_BUCKET="nodebbs" export OSS_DEFAULT_REGION="oss-cn-shanghai" export OSS_UPLOADS_PATH="/assets"
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    1 Views
  • How to set meta tag in plugin ?

    2
    0 Votes
    2 Posts
    2k Views
    barisB
    Starting with 1.6.0 you can use plugins.fireHook('filter:meta.getMetaTags', { req: req, data: data, defaultTags: defaultTags }, next); If you want to do it on 1.5.2 you can try the below using the the hook filter:topic.build. myPluign.onTopicBuild = function (hookData, callback) { hookData.res.locals.metaTags.push({ property: 'tags', content: 'abc, def' }); callback(null, hookData); };
  • Send hardcoded text as composer textfield data

    3
    0 Votes
    3 Posts
    2k Views
    S
    @baris Could you explain how I can do to send text as if it were the editor so that the composer does not throw error that it enters more than 0 characters?
  • How to remove post submit restrictions?

    Unsolved
    10
    0 Votes
    10 Posts
    3k Views
    S
    @julian Cool, and... How can we do what you suggest to send text if we remove the textfield in the composer template?
  • First release pass nodebb-plugin-fileownership

    8
    3 Votes
    8 Posts
    3k Views
    ShardS
    There are a few methodology issue I have here right now. The biggest being that the upload hook fires before a post is posted. This means files that aren't uploaded ( edited out after uploading ) with the post get stored. I need to sort out how to move this to the post hook and process that instead. Learning curve and all. For the moment, this works well enough for the other work I need so I'll be more focused that way for a bit, but I expect to come back to this for enhancement shortly. If you have requests/feature ideas Add it to the issue tracker on bitbucket. https://bitbucket.org/abquintic/nodebb-plugin-fileownership/issues?status=new&status=open
  • How to determine if parse.post is inside a topic?

    3
    0 Votes
    3 Posts
    1k Views
    Esteban ConstanteE
    Yep, ended up using posts.isMain function.
  • filter:uploadFile

    1
    0 Votes
    1 Posts
    942 Views
    ShardS
    I'm working on a plugin that filters out a specific file type and relocates them to a different folder. Everything works as I want except for two issues that I expect are approximately the same solution. Since uploadFile fires on all files, I need to do an early filter against the extension/mimetype and exit out on a non-match. When I do so, I am firing the callback with (null, data ) where data is the past object for the filter then returning. The resulting link that shows up in the message has a bad URL. Similarly, when it passes the extension check, it throws an exception due to the uploaded temp file being moved by my plugin. I assume in both cases this is an issue with what need to get sent back when the filter wraps up its business for the rest of the "upload" flow. Looking at uploads.js hasn't helped me parse it out. Looking at the imgur plugin has me more confused than understanding. Anyone know what needs to occur here?
  • Commission: Update Plugin to 1.5 and Tweak

    8
    0 Votes
    8 Posts
    3k Views
    M
    @Giggiux said in Commission: Update Plugin to 1.5 and Tweak: @Michael-Pfaff I have no clue on how the plugin works, but from the error stack-trace you're trying to use a method .replace on an undefined object, in the file nodebb-plugin-dice-bot/src/dice.js at line 84. Try to see if .replace() is called there, and check with the debugger why the object it's been called on doesn't exist. Edit: I think it has something to do with the "create post hook", or something like that. Thanks! This gives me a lead at least. I'll take a look and see if I can figure some shit out.
  • Getting specific categories through the API

    3
    0 Votes
    3 Posts
    2k Views
    S
    @baris thanks, that is exactly what I looked for: var userProvidedCatIds = widget.data.catIds; if (!userProvidedCatIds || userProvidedCatIds === '0') { categories.getCategoriesByPrivilege('cid:0:children', widget.uid, 'find', render); } else { categories.getCategories(userProvidedCatIds.split(',').map(Number), widget.uid, render); } function render(err, data) { app.render('categories.tpl', { categories: data, relative_path: nconf.get('relative_path') }, function (err, html) { widget.html = html; callback(err, html); }); } Is there any doc-site / rtfm for the JS-API or do we have to look at the source to find appropriate methods and their parameters?
  • Plugin-Internalization: Build not grabbing language-file?

    5
    0 Votes
    5 Posts
    2k Views
    S
    @PitaJ thanks for the info
  • nodebb torrents tracker

    6
    0 Votes
    6 Posts
    3k Views
    julianJ
    @yariplus is saying it's possible to create such a plugin, not that he would do it
  • Plugin headstart guide/Help

    1
    0 Votes
    1 Posts
    1k Views
    Onigbinde Ayomide SnrO
    Hey guys. I recently picked up NodeBB (needed it for a client) and it was (still is) awesome. However, I need help with Plugin development. I could have sat down and dissect the docs (which seems scatterd BTW), but I am super duper busy. . . And I wish to develop the plugin ASAP. So I need a link or anything (blog posts, Youtube videos, books, etc) to get me started. A blog tutorial that outlines the plugin dev process and probably builds a sample plugin would be super helpful.... And BTW, my Nodejs skills is about 6 on a scale of 10, so a dummy approach would be highly appreciated.
  • Are older plugins still working with the latest version?

    5
    0 Votes
    5 Posts
    2k Views
    R0cketR
    @pichalite thanks are these updates to match the latest version usually just little tweaks?