1. You can use template_create event to load different template.
2. You can use template_post_render event to replace contents, but this is a bad idea because old template would be rendered before its replaced, which would waste resources.
3. You can use template modification to replace entire contents with regex. In replace field put new content, in search field put this: