Update templates.php

Added boolean conditionals support.