Adding buttons to posts
-
Hello all!
I'm trying to add a button to all posts from a plugin. I'd rather do it serverside if possible, and it seems that some kind of support for this did exists at least:
Adding a button to each post
The loop to add buttons was merged into persona. A similar addition should probably be added to vanilla. I now add buttons in my plugin via hook filter:post....
NodeBB Community (community.nodebb.org)
This doesn't seem to work any more.
Any pointers on how to do this best? Ideally I'd want another button next to "reply", although adding it to the post dropdown wouldn't be terrible either.
-
I don't see anywhere to add buttons, but the post.tools filter does add things to the dropdown.
If you ask me though, there should be an additional block and filter there to add buttons. I suggest
filter:post.buttons
. -
@yariplus said:
I suggest filter:post.buttons
That would be nice.
Meanwhile,
filter:post.tools
doesn't seem to get triggered... I may be doing it wrong due to being a noob but I'm doing this:"hooks": [ { "hook": "filter:post.getPosts", "method": "getPosts" }, { "hook": "filter:post.tools", "method": "buildPostTools" } ],
And in JS I just did this so I can inspect the object I get:
Plugin.buildPostTools = function(data, cb) { console.log('building post tools'); console.log(data); cb(null, data); };
But it's not getting called?
getPosts
works fine.(I'm also probably missing an error object there)
-
There is nodebb-plugin-slack, but it looks like it's not been updated in a while and may no longer run on latest nbb. I don't see anything for irc. If your forum isn't huge, putting an iframe of an embedded irc client into an HTML widget may be be doable for you.
-
@yariplus I meant a place to chat and get help, not install it as a plugin on my forum
Also, I can't find a way to hook into click events on the button. Tried searching through other plugins but I didn't find anything that would demonstrate this. I did see some of the base plugins using
action:controller.method
syntax but these don't seem to get triggered automatically?Sorry for being a bit of a pain but the docs are a bit scarce, and while I'm OK with JavaScript in general my NodeJS knowledge is... lacking, at best, so poking around the source is not something that's very effective in my case.