Client-side template injection