No, you are not getting the point. Any logic flow control should not be in the templates because this simply rules out that majority of the real presentation designers.
If you need to iterate over the same template, like in alternating table row colors, just do it in the programming. That is what programming is meant to be, control the program output logic flow.
Template engines like Smarty that make you handle any logic in the templates are not a great improvement over the traditional PHP programming. They require you to learn a third language that is neither PHP nor HTML.
Properly conceived templates should only contain HTML, placeholders and delimiters, so they can be edited in any HTML editor and any good graphic designer can do his job and not have to learn that third language.