How to add the first three elements of a for loop in sightly and show the value as Total. I have code as below
{{each(i, provision) provisionTypes}}
{{/each}}
What I want to do is that in the each for loop, I want to display to the total of the first three elements... Not sure how to?
Best How To:
I don't think that is possible in Sightly. It is meant to be only for presentation purposes. it even lacks arithmetic operations, so you cannot really add numbers with it. You'll have to do it in the backend. You can use the WCMUse API (in it's java or javascript forms) to add some logic to your component