Resize Image Plugin

Locked NodeBB Plugins

Suggested Topics


  • 0 Votes
    3 Posts
    200 Views

    I suspect the error was caused by a corruption somewhere. I'd suggest deleting node_modules and reinstalling. Maybe even try clearing your npm cache.

  • 0 Votes
    8 Posts
    482 Views

    @julian at the moment I don't use the built in methods:

    https://github.com/pitaj/nodebb-plugin-calendar/blob/main/src/client/eventModal.ts#L50

    As there is no way to do the following:

    read text contents to check for an existing event do a regex replacement on the text contents

    I don't know anything about quil, so I can't really help there.

  • 0 Votes
    7 Posts
    914 Views

    Works great in 8.x now 😉

  • 0 Votes
    6 Posts
    2k Views

    OK, Default version npm i nodebb-plugin-emoji-one

  • 0 Votes
    2 Posts
    3k Views

    You define routes in your load hook. So your library.js might look like this:

    var Plugin = module.exports = {}; Plugin.load = function (params, callback) { var router = params.router; var middleware = params.middleware; // Define the function that renders the custom route. function render(req, res, next) { // Get whatever data you want to send to the template here. var data = {whatever: 33}; // This is the path to your template without the .tpl, relative to the templates directory in plugin.json var template = 'templatename' // Send the page to the user. res.render(template, data); } // This actually creates the routes, you need two routes for every page. // The first parameter is the actual path to your page. router.get('/yourpage', middleware.buildHeader, render); router.get('/api/yourpage', render); callback(); };

    And your plugin.json would look something like this:

    { "library": "library.js", "hooks": [ { "hook": "static:app.load", "method": "load" } ], "templates": "./public/templates", "staticDirs": { "public": "public" } }

    and you would have a template here:
    /nodebb-plugin-yourplugin/public/templates/templatename.tpl

    <h2>My Awesome Custom Page</h2> The Magic Number is: {whatever}

    I'm pretty sure I posted about this before, with more details even. Have to start using those canned responses. 🌹