Get template by path or class