Closed Yoslandy closed 1 year ago
You can use handlebar helper functions and pass the @index as parameter to it and do any operation on it.
Handlebar helper function approach is in the documentation of dynamic text
handlebars.registerHelper("replace", (context, pattern, replacement) => context.replace(pattern, replacement) );
@samant-rags Thank you for the help.
@Yoslandy Here is how it looks like:
Content:
{{#each data}}
Index {{inc @index}}<br/>
{{/each}}
JavaScript:
handlebars.registerHelper("inc", (value) => parseInt(value)+1);
Hi Team.
Im trying to sum a value to the @index variable in this wonderful plugin. Especially sum 1 to the variable to show an order.
Example
I would like, instead shows Lot 0, Lot 1,... that starts from Lot 1, Lot 2,... to not create confusion to the cliente.
Is there any way to do that? (I tried but give me errors like is not permited)
Thanks so much again and in advance