template with events