put the index into a template