Unexpanded tokens in topics list parsed template output. No errors
-
I have an object that has an array of topics
obj = { topics:[ topic1, topic2, topic3 ] }
The topics in this object are sorted in a desired order.
If I dynamically load a template (on the client side) and then
try to use it to render this list usingajaxify.loadTemplate('partials/topics_list', function(temp) { var html = templates.parse(temp, obj ) console.log(html) });
I get html that is exactly what I want but also has things like
[[global:posts]]
and[[category:no_replies]]
. I'm getting the feeling that those were supposed
to be expanded by the parser.Is partials/topics_list expecting obj to have more things other than the
topics: []
and failing (silently?) because of that? Is there a second pass that needs to be invoked
aftertemplates.parse
?Goals: I rolled up a custom list of topics which I'd like to display on the frontend
-
@baris said in Unexpanded tokens in topics list parsed template output. No errors:
Check out the method app.parseAndTranslate
Doesn't look like it can work as a drop in replacement for
templates.parse
Could you point me to the documentation/Unminified Source code for this function? How do I use it?
Edit: Managed to get the unminified source by doing
./nodebb dev
(was doingNODE_ENV=development node ./app.js
before -
@Qwertyzw in the future, you can use the Github search to find the source code for different apis.