How can I assign variable in .tpl?
-
You can't assign variables in benchpress templates. You'll have to inline the value instead:
<div ...> {{{ each children }}} {{{ if (cid == children.y) }}} <div ...> </div> {{{ end }}} {{{ end }}} </div>
See the benchpressjs docs for more info:
https://github.com/benchpressjs/benchpressjs/tree/master/docs
-
@PitaJ Actually, I need double loop.
{{{ each ../children }}} x = ../cid {{{ each leaves }}} {{{ if x == leaves.yy }}} (L4) {{{ end }}} {{{ end }}} {{{ end }}}
If I write '../cid' instead of 'x' at L4, ../cid is cid of leaves not of children.
Do you know any solution? -
@ghdms
../../cid
Copyright © 2024 NodeBB | Contributors