@pichalite Works perfectly! I got my Subcategories back - thanks so much for your help!
Saari
Posts
-
Showing Subcategories on the Mainpage with 0.9.3 -
Showing Subcategories on the Mainpage with 0.9.3Hello everyone,
I modified the Persona Theme so that Subcategories are shown on the Mainpage and not only on the Category-Page. That worked well so far in 0.8.3; I just modified the templates/categories.tpl by adding basically this:
[...]
<!-- BEGIN categories -->
<!-- IMPORT partials/categories/item.tpl -->
<!-- IF categories.children.length -->
<!-- BEGIN children -->
// HTML Representation of a Subcategory
<!-- END children -->
<!-- ENDIF categories.children.length -->
<!-- END categories -->
[...]That gave me a Overview like this:
After upgrading to 0.9.3, I dont get this to work anymore. If I use my old code above, NodeBB logs following Stacktrace:
error: RangeError: Maximum call stack size exceeded
at String.match (native)
at checkConditional (/path/to/nodebb/node_modules/templates.js/lib/templates.js:224:26)
at checkConditionals (/path/to/nodebb/node_modules/templates.js/lib/templates.js:220:27)
at parseValue (/path/to/nodebb/node_modules/templates.js/lib/templates.js:386:14)
at parse (/path/to/nodebb/node_modules/templates.js/lib/templates.js:405:17)
at cleanup (/path/to/nodebb/node_modules/templates.js/lib/templates.js:476:27)
at parse (/path/to/nodebb/node_modules/templates.js/lib/templates.js:422:15)
at cleanup (/path/to/nodebb/node_modules/templates.js/lib/templates.js:476:27)
at parse (/path/to/nodebb/node_modules/templates.js/lib/templates.js:422:15)
at cleanup (/path/to/nodebb/node_modules/templates.js/lib/templates.js:476:27)
RangeError: Maximum call stack size exceeded
at String.match (native)
at checkConditional (/path/to/nodebb/node_modules/templates.js/lib/templates.js:224:26)
at checkConditionals (/path/to/nodebb/node_modules/templates.js/lib/templates.js:220:27)
at parseValue (/path/to/nodebb/node_modules/templates.js/lib/templates.js:386:14)
at parse (/path/to/nodebb/node_modules/templates.js/lib/templates.js:405:17)
at cleanup (/path/to/nodebb/node_modules/templates.js/lib/templates.js:476:27)
at parse (/path/to/nodebb/node_modules/templates.js/lib/templates.js:422:15)
at cleanup (/path/to/nodebb/node_modules/templates.js/lib/templates.js:476:27)
at parse (/path/to/nodebb/node_modules/templates.js/lib/templates.js:422:15)
at cleanup (/path/to/nodebb/node_modules/templates.js/lib/templates.js:476:27)and restarts everytime he tries to load the theme, so nodebb is only working if I switch themes. I'm running NodeJs 4.2.3 (with 0.10 it didnt work either and the error was undefined undefined).
I played around a bit and found out that it dies when I try to call <!-- BEGIN children -->. I also tried to call <!-- BEGIN categories.children --> (wont work) and tried to move the inclusion to templates/partials/categories/item.tpl as
<!-- IF ../children -->
<!-- BEGIN children --><!-- END children -->
<!-- ENDIF ../children -->This gives me the same Exception with a slightly different stacktrace
RangeError: Maximum call stack size exceeded
at new RegExp (native)
at makeConditionalRegex (/path/to/nodebb/node_modules/templates.js/lib/templates.js:202:10)
at checkConditional (/path/to/nodebb/node_modules/templates.js/lib/templates.js:224:32)
at checkConditionals (/path/to/nodebb/node_modules/templates.js/lib/templates.js:220:27)
at parseValue (/path/to/nodebb/node_modules/templates.js/lib/templates.js:386:14)
at parse (/path/to/nodebb/node_modules/templates.js/lib/templates.js:405:17)
at cleanup (/path/to/nodebb/node_modules/templates.js/lib/templates.js:476:27)
at parse (/path/to/nodebb/node_modules/templates.js/lib/templates.js:422:15)
at cleanup (/path/to/nodebb/node_modules/templates.js/lib/templates.js:476:27)
at parse (/path/to/nodebb/node_modules/templates.js/lib/templates.js:422:15)
RangeError: Maximum call stack size exceeded
at new RegExp (native)
at makeConditionalRegex (/path/to/nodebb/node_modules/templates.js/lib/templates.js:202:10)
at checkConditional (/path/to/nodebb/node_modules/templates.js/lib/templates.js:224:32)
at checkConditionals (/path/to/nodebb/node_modules/templates.js/lib/templates.js:220:27)
at parseValue (/path/to/nodebb/node_modules/templates.js/lib/templates.js:386:14)
at parse (/path/to/nodebb/node_modules/templates.js/lib/templates.js:405:17)
at cleanup (/path/to/nodebb/node_modules/templates.js/lib/templates.js:476:27)
at parse (/path/to/nodebb/node_modules/templates.js/lib/templates.js:422:15)
at cleanup (/path/to/nodebb/node_modules/templates.js/lib/templates.js:476:27)
at parse (/path/to/nodebb/node_modules/templates.js/lib/templates.js:422:15)Has anyone an idea why this isn't working anymore/where my mistake is? What is causing this error? I would really like my subcategories back at my mainpage.
Thanks for your help!