If you have a repeating region in your template and it doesn’t need a wrapper around it, simply use section
{section name=s loop=$images}
{/section}
Cases where you need html wrap tags is like this
{if $navlinks}
-
{section name=s loop=$navlinks}
{/section}
This avoids the <ul> being rendered if $navlinks don’t have a return record. Another way is to access Smarty properties
{section name=s loop=$navlinks}
{if $smarty.section.s.first}
- {/if}
{if $smarty.section.s.last}
But still, this adds an if in the template. As this post title goes, you should avoid them, that’s the basics of OOP system and MVC frameworks, separate logic from code
What made me write this post? Template Designers sometimes hate seeing if statements. In my case, my boss transforms into savvy Designer as well, at times! Bummer