Alter Compiled Templates...


Well-known member
Maybe I'm just missing it, but is there a way to hook into XenForo_Template_Compiler_Admin::compileParsed() ?

Basically I'd rather alter a compiled template vs. doing a find/replace every time a template is rendered (more efficient).


Well-known member
You can extends the DataWriter (XenForo_DataWriter_Template) then hook yourself into the set() method, wait until 'template_parsed' is set and do your job. Anyway, I don't recommend this because compiled template is way too complicated to alter. Also, if your add-on do this, you will have to trigger a template save for each template you change. Is it worth it?