P粉7162282452023-09-02 16:58:17
This is the method I use to do something similar, increment a value inside a loop, and pass that value to the included file. try it:
First.tpl
{assign var="counter" value=0} {foreach ...} /* iterates at least 100 times */ {assign var="counter" value=$counter+1} {include file='Second.tpl' counter=$counter} {/foreach}
Second.tpl
{$counter} /* Check if counter increase */ {if $counter > 10} do-something {/if}
Notice. - I initialize $counter
to zero.