Add tag function to templates.