Includes validation code in Template.php