Your example actually looks like a namespace disaster about to happen with "id". Needs some prefixing and/or improved naming conventions. I'm not really how making your template have "less logic" than your example would produce a usable template language.