Resolve template based on config