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

Why is template_post_render not triggered for xen:include?

Discussion in 'XenForo Development Discussions' started by Naatan, Mar 1, 2012.

  1. Naatan

    Naatan Well-Known Member

    I've had several cases where I was unable to use a listener for this event due to the xen:include exception. I went through the code and could find no reason why you couldn't just trigger the event in "/XenForo/Template/Compiler/Tag/Include.php".

    I just want to know what the reasoning for this decision is and whether we can expect to see it fixed in the future.

  2. guiltar

    guiltar Well-Known Member

    There are 4 states of template: text, parsed, compiled, rendered html.
    Template Post Render works with the rendered html. Include tags are handled when parsed template is being compiled (when saving or rebuilding).
    There are no listeners in compiler probably because addons are expected to be enabled/disabled instantly and without a trace.
    If there were listeners in compiler you may need to rebuild all templates to disable some addons.
    What exact problem do you have?
  3. Naatan

    Naatan Well-Known Member

    That makes sense, but doesn't XF already recompile the templates when you install / uninstall an addon?

    I'm not having a serious problem, it's just an inconvenience and I'm wondering what's the reasoning behind this.
  4. Naatan

    Naatan Well-Known Member

    Just noticed your Template Modification System, this is a very nice solution to the inconveniences I was encountering. Thank you for your efforts :)

Share This Page