Yes, you can set the parameters of the named template in the tag where you use tmpl="myBtnTmpl" (be it the {{if}} tag or the {{for}} tag):
<div class="BigButton"> {{for myData ~arrIndex=0 tmpl="myBtnTmpl"/}} </div>
You can then access the template parameter in the same way as a registered helper by adding '~' to the name.
<button class="btn"> {{:myData.myArray[~arrIndex].btnName}} </button>
By the way, you can also pass variables and helper functions (in addition to data) using the rendering method. I just added a new demo showing it.
So, this means that templates can be "parameterized" in the same way, regardless of whether you deny them from the code or declaratively, as in your nested templates above.
source share