So I have an assigned variable in smarty:
{assign var=number value=0}
Now I can increment it using
{$number++}
Better to use the built in Smarty "counter" >> {counter} element.
So, in template you can use:
Some text, html code, whatever...
{* init the counter! *}
{counter start=0 print=false} {* now the tpl doesn't show the "0" number *}
{* 3x run :D *}
{some_cyclic_stuff_like_foreach_or_section}
Run the counter: {counter}
{/some_cyclic_stuff_like_foreach_or_section}
It will print for you:
Run the counter: 1
Run the counter: 2
Run the counter: 3
So, at least, you can use it with the print=false option, and you have the counter but it's hidden.
If you use it the "variable way" (like the upper section write) you also can hide it with html/css or just simply don't let it print :)