Added sort related ids by type function
Added tab template for locations