get all posts

Plugin Development

Suggested Topics


  • 0 Votes
    9 Posts
    187 Views

    @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 of https: 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 think calculator: 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. via spotify: 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 right href= 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)

  • 0 Votes
    2 Posts
    404 Views

    @sebastián-cisneros In static:api.routes, you'll want to call controllerHelpers.setupAPIRoute to mount the route to the appropriate /api/v3/plugins mount point.

    You can see an example of how we do it in the quickstart plugin

  • 0 Votes
    1 Posts
    188 Views

    Hi, I have following:
    {
    "hook": "filter:config.get",
    "method": "configGet"
    }

    My purpose is to use my own sort method for sorting topics in a category, automatically modifying visible "Sort By" html element with a special sorting method that I implemented, and make it selected automatically.

    I tried many hooks but "filter:config.get" was only one that is called before rendering or sending anything to client side. Other hooks such as "filter:categories.buildTopicsSortedSet", "filter:categories.getSortedSetRangeDirection","filter:category.topics.prepare", they all didn't work.

    For example, if I changed like following in a method for "filter:categories.buildTopicsSortedSet":
    data.settings.categoryTopicSort = 'most_myown';
    but in client side, it only shows the previous value of "data.settings.categoryTopicSort", not the value "most_myown".

    So I had to use "filter:config.get" because changing config there actually reflects to client side.

    To implement it, I first need to check information about category that the user just entered, and append it to config, and send it to client. They are supposed to be done in "configGet" method, which you see above. But I do not know how to get information about category that the user is in. I need to know about category info because my own sorting will only work for certain categories.

    Thank you very much.

  • 0 Votes
    4 Posts
    2k Views

    @lewismcmahon There's no way to know what the full url is besides what's presented in config.json, since multiple URLs can point to the same NodeBB.

    The nconf solution is the easiest.

  • 0 Votes
    3 Posts
    2k Views

    Hello Julian. Thank you for your very useful answer.
    The plugin was an old version.
    I just did uninstall then reinstall the last nodebb-api-write plugin (version 3.1.5) on our instance, but now I get the following error :
    /admin/plugins/write-api Introuvable (not found)