Set up template inheritance.