Is it possible to customize the footer of a post via a plugin?
-
If you're fine with using the tools menu (under three dots) you can use
filter:post.tools
hook to add your own action there.
For an example see the Question and Answer plugin: https://github.com/NodeBB/nodebb-plugin-question-and-answer/blob/e339a029c1633aa1cadc5e7df7cfa7c322fef435/library.js#L200-L217 -
@jszsj said in Is it possible to customize the footer of a post via a plugin?:
I want to add a link to launch a local app via url protocol
I'm not sure exactly what you mean, local app .. where? Local to the nodebb server?
Whats the app going to be doing. Just wondering if that can be coded in the widget? -
@eeeee Probably local to the user computer
You can generally use non-http URIs for launching different applications. If you were ever redirected from a desktop or mobile app to a browser to log in you've probably seen this in action. Windows actually uses some internally and usually transparently for the user (for example, to abuse their monopoly, MS started using
microsoft-edge:
scheme instead ofhttps:
in some links in Windows to only allow opening them in Edge. They didn't have to build some highly custom mechanism, just restrict other apps from registering this scheme), but usually can be just registered by applications you install. What they do also depends on the application - for example, I thinkcalculator:
only launches the calculator app (or at least the obvious way to write math doesn't work), but others can launch specific actions and even pass some information (for example, authentication token for the web login use case I mentioned). For example Spotify allows linking to artists, playlists, albums etc. viaspotify:
scheme and steam supports doing a ton of things via URI, including launching and even installing/uninstalling games.All you need is an
<a>
tag with the righthref=
set. So yeah, you can put that kind of a link in a widget, but if they wanted to have it be an action under a post, especially if it was supposed to include some information from the post, it wouldn't be that simple.
(side note: NodeBB doesn't allow links using non-standard schemes in markdown, so you can't just put something like this in a post or signature)