Answer the question
In order to leave comments, you need to log in
How to output content of smarty loop only 1 time?
hello, please tell me how to display the contents of the loop only 1 time after 5 elements?
{if $smarty.foreach.listings.index %5 ==0}
...
{/if}
Answer the question
In order to leave comments, you need to log in
Offhand, there are two ways - either add a flag variable that we have already been in this condition and do not go here anymore (at first, the variable is equal to false, when we entered the condition, it was set to true, and && var == false was added to the condition. The second way is when entered the condition and executed the code there, then at the end do {break}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question