Give templates unique IDs