Add support for templating in vars_prompt - fixes #7959