Use Template Files



  • Hello,

    i am creating currently a shoutbox synchronisation for a game. I have created a custom route and a custom template. How can i now extend the template, that i have the header and the footer from the theme?
    I have tryed following:

    <!-- IMPORT header.tpl -->
    Test
    <!-- IMPORT footer.tpl -->
    

    It kills everytime nodebb, if i request the page. Have someone a idea how can i handle that?


  • Admin

    What error does the server output?



  • Output:

    27/3 16:06 [5426] - info: NodeBB is now listening on: 0.0.0.0:4567
    27/3 16:06 [5426] - error: TypeError: Cannot read property '@index' of undefined
        at helpers.displayMenuItem (/root/NodeBB/public/src/modules/helpers.js:13:29)
        at checkConditionalHelpers (/root/NodeBB/node_modules/templates.js/lib/templates.js:269:76)
        at parse (/root/NodeBB/node_modules/templates.js/lib/templates.js:424:15)
        at parseTemplate (/root/NodeBB/node_modules/templates.js/lib/templates.js:133:14)
        at Object.templates.parse (/root/NodeBB/node_modules/templates.js/lib/templates.js:119:11)
        at /root/NodeBB/node_modules/templates.js/lib/templates.js:169:30
        at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:404:3)
    TypeError: Cannot read property '@index' of undefined
        at helpers.displayMenuItem (/root/NodeBB/public/src/modules/helpers.js:13:29)
        at checkConditionalHelpers (/root/NodeBB/node_modules/templates.js/lib/templates.js:269:76)
        at parse (/root/NodeBB/node_modules/templates.js/lib/templates.js:424:15)
        at parseTemplate (/root/NodeBB/node_modules/templates.js/lib/templates.js:133:14)
        at Object.templates.parse (/root/NodeBB/node_modules/templates.js/lib/templates.js:119:11)
        at /root/NodeBB/node_modules/templates.js/lib/templates.js:169:30
        at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:404:3)
    27/3 16:06 [5426] - info: [app] Shutdown (SIGTERM/SIGINT) Initialised.
    27/3 16:06 [5426] - info: [app] Database connection closed.
    27/3 16:06 [5426] - info: [app] Web server closed to connections.
    27/3 16:06 [5426] - info: [app] Shutdown complete.
    27/3 16:06 [5460] - info: Time: Sun Mar 27 2016 16:06:43 GMT+0200 (CEST)
    27/3 16:06 [5460] - info: Initializing NodeBB v1.0.2
    

    //


Log in to reply
 


Star

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