I am not usually a Smarty guy, so I\'m a bit stuck.
I want to echo the index of an array, but I want to increment it each time I echo it.
This is what I have...<
If it's smarty 2 (which from the foreach syntax you're using it looks like) you can give the foreach loop a name and then use {$smarty.foreach.name.index}
like so
{foreach from=$gallery key=index item=image name=foo}
-
{/foreach}
The index starts at zero, if you want a sequence that starts at 1 use .iteration instead of .index
I haven't used smarty for quite a while now but I always found the official documentation very good with lots of examples http://www.smarty.net/docsv2/en/language.function.foreach.tpl