Why is template_post_render not triggered for xen:include?

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.

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

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.
 
Just noticed your Template Modification System, this is a very nice solution to the inconveniences I was encountering. Thank you for your efforts :)
 
Back
Top Bottom