How can I get all Group name created?

NodeBB Plugins

Suggested Topics

  • 1 Votes
    1 Posts

    with credit system,


  • 0 Votes
    3 Posts

    @PitaJ Thanks! I will learn these plugins from you and hope I can contribute some to the nice ecosystem in future.

  • 0 Votes
    5 Posts

    @pichalite said in Is there an option that users can hide a category from the forum?:

    @MJ well... you are trying to do it the harder way.

    Yes, I know 😛 people tell me everyday haha.

    But maybe are there more people who want an option for choose if they want to see adult content or not. 🙂

  • 0 Votes
    2 Posts

    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:

    <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. 🌹

  • Getting user data from UID

    NodeBB Plugins
    0 Votes
    3 Posts

    Just saw this section on the git! Thank you so much for showing me an example ^_^