Hmmm... I could do something like this:
I end up needing this a lot when I’m generating complex forms, especially ones that get updated via AJAX (i.e. Javascript). E.g.
<input type="text" name="array_of_stuff[1][key]" value="some value" />
The problem is that for some series of elements, the [1] has to stay the same, in order to group a series of values onto the same containing "array_of_stuff", in which case, I’d need an output filter that could identify a group of elements while still incrementing... in other words, the incrementing would have to be paused sometimes.
<label>First group of elements for record 1</label>
<input type="text" name="array_of_stuff[ [[+i:seq=`inc`]] ][key1]" value="some value1" />
<input type="text" name="array_of_stuff[ [[+i:seq]] ][key2]" value="some value2" />
<input type="text" name="array_of_stuff[ [[+i:seq]] ][key2]" value="some value3" />
<label>Second group of elements for record 2</label>
<input type="text" name="array_of_stuff[ [[+i:seq=`inc`]] ][key1]" value="some other value1" />
<input type="text" name="array_of_stuff[ [[+i:seq]] ][key2]" value="some other value2" />
<input type="text" name="array_of_stuff[ [[+i:seq]] ][key2]" value="some other value3" />
So "normal" usage would be [[+i:seq=`inc`]], which would always increment the counter and return the result, whereas [[+i:seq]] would return the value of the counter. Yeah... I think that’s what I need. Just a basic output filter that doesn’t care what variable it’s filtering because it will overwrite the value.