[nodebb-plugin-custom-homepage] Basic CMS plugin - custom homepage

NodeBB Plugins

Suggested Topics


  • 0 Votes
    6 Posts
    108 Views

    @DownPW Good call. I've done the same ๐Ÿ™‚ Great minds and all that...

  • 0 Votes
    3 Posts
    2k Views

    The underlying dependency makes it difficult to support Chinese. Looks like you have it working with the Solr plugin now.

  • 0 Votes
    7 Posts
    2k Views

    @rspk should be resolved ๐Ÿ˜‰

    Users restore: null object ยท Issue #2 ยท NicolasSiver/nodebb-widget-ns-stats

    NodeBB's module User.getUserData can produce null objects. Plugin should filter them. Issue is related to user deletion.

    favicon

    GitHub (github.com)

  • 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. ๐ŸŒน

  • 1 Votes
    1 Posts
    2k Views

    Sup guys?

    I did a plugin for who wants to keep files on AWS S3. It's good for who keeps the NodeBB on Heroku or others servers that have ephemeral filesystem.
    I wanted to maintain compatibility with NodeBB 0.6.x and nodebb-plugin-s3-uploads doesnt worked for me.

    I will need to increase some features like content access control in the next version.

    Build software better, together

    GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 330 million projects.

    favicon

    GitHub (github.com)