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

Alter Compiled Templates...

Discussion in 'XenForo Development Discussions' started by digitalpoint, Oct 15, 2011.

  1. digitalpoint

    digitalpoint 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).
     
    Marcus likes this.
  2. Marcus

    Marcus Well-Known Member

    That would be a huge speed improvement.
     
  3. xfrocks

    xfrocks 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?
     

Share This Page