allowing template selection by domain id