Add function definition to the template.