Only create template variables when using a template file