rendering Engine template.js : Import statement in IF statement

Bug Reports
  • 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)

  • @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


Suggested Topics