XF 1.5 Replacing Template


Previously Cylent1
How does one go about replacing an entire template through a option call?

For example: I need to call on a template (Custom header template), to replace the original template (Header Template).
Last edited:


Well-known member
There are 3 ways to do that:

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: