Variable's reference in tpl files
-
Hi Team,
I would like to know how can i decrease the post counts(simply want to perform -1 from total count which it is displaying), as it is counting as the description in posts as well. please refer to the attached image.
I have tried by changing
topics: ajaxify.data.topics.map(topicsData => {topicsData.postcount = topicsData.postcount-1; return topicsData;})- topicList.js(under public/src/modules)
- category.js(under public/src/client)
but still no success. Is this the correct JS file using for the reference of {topics.postcount} variable in topics_list.tpl ?
-
@arc002
ajaxify.data
is just the data the template was run with. Changing it does nothing to the already rendered page.What you want is to add a hook for
filter:topics.get
and modify the data there.NodeBB/src/topics/index.js at dbb59228f2ded01ee5829bbd71363ccbd568e6b5 · NodeBB/NodeBB
Node.js based forum software built for the modern web - NodeBB/src/topics/index.js at dbb59228f2ded01ee5829bbd71363ccbd568e6b5 · NodeBB/NodeBB
GitHub (github.com)
Copyright © 2024 NodeBB | Contributors