How get Index in <!-- BEGIN posts --> <!-- END posts -->
-
According to the code it's
@ index
(or@key
for objects).
EDIT: without spaces, NodeBB bug detected xD
EDIT2: bug reported gh#4426 -
@frissdiegurke for example I create this label:
<!-- BEGIN posts -->
<label for="text">TEXT @ index</label>
<!-- END posts -->And I print "TEXT 0", "TEXT 1"... so it's work but I need to start from "TEXT 1" not from "TEXT 0". I try this but it's not work:
<label for="text">TEXT @ index+1</label>
Can you suggest me the solution?
-
Syntax seems strange to me.
<!-- BEGIN posts --> @ index <!-- END posts -->
works
but it should be something like
<!-- BEGIN posts --> {posts.@ index} <!-- END posts -->
-
Calculations/Evaluations are not part of the lightweight template engine NodeBB uses. (AFAIK)
I guess the best would be to intercept the
filter:post.getPosts
hook and add your custom index values...
Copyright © 2024 NodeBB | Contributors