• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 Replacing Template

[xFv]

Previously Cylent1
#1
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:

Arty

Well-known member
#2
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:
Code:
#^.*$#s