Specify that template can be a string and a function.