rendering Engine template.js : Import statement in IF statement



  • I want to import different partial templates based on IF statement. Maybe a bug here:

    <!-- IF loggedIn -->
      <!-- IMPORT partials/topics_list.tpl -->
    <!-- ELSE -->
      <!-- IMPORT partials/topics_list_diy.tpl -->
    <!-- ENDIF loggedIn -->
    

    RangeError: Maximum call stack size exceeded
    at String.match (native)
    at checkConditional (D:\workspace\NodeBB->1.0.3\node_modules.npminstall\templates.js\0.3.4\templates.js\lib\templates.js:227:26)
    at checkConditionals (D:\workspace\NodeBB->1.0.3\node_modules.npminstall\templates.js\0.3.4\templates.js\lib\templates.js:223:27)
    at parseValue (D:\workspace\NodeBB-1.0.3\node_modules.npminstall\templates.js\0.3.4\templates.js\lib\templates.js:389:14)


  • Plugin & Theme Dev

    @K68 do you have the tpl partials/topics_list_diy.tpl available in the theme?



  • @pichalite
    Yes, I created a copy of partials/topics_list.tpl. Then I renamed it to partials/topics_list_diy.tpl


Log in to reply
 


Star

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