Overriding template

  • Global Moderator

    How does NodeBB decide which order to override templates? I'm trying to override the homepage.tpl plugin from nodebb-plugin-custom-homepage in a theme, but it doesn't seem to be working correctly. Is this because plugins take preference over themes?

    If so, is there a way to manually override templates programmatically?

  • Admin

    You can order the plugins load order in the acp from the plugins page, not sure if that also changes the overriding of the templates though.

  • Global Moderator

    @baris It seems you can't change the order of themes from that interface.

    Is there a way of directly overriding the template manually?

    Here's how everything is set up:

    nodebb-plugin-custom-homepage has the original homepage template

    nodebb-theme-blah has the template I want to use on the homepage
    It has a special widget area that I need. I don't want to completely replace the template file, but it looks like I may have to, or at least copy the file into the compiled templates directory on app.load

  • Admin

    Yeah that's how @psychobunny does it in some of his plugins. There isn't a more elegant way right now as far as I know, the loading order determines the template used but you can't arrange the themes in that list so maybe that's what we should add.



Looks like your connection to NodeBB was lost, please wait while we try to reconnect.