XF 2.0 Add variable to a global template

S Thomas

Well-known member
I have a template which is included in PAGE_CONTAINER, thus present on every page. I want to add a variable to this specific "global" template. I tried the callback tag, but callbacks only support strings as return value. Of course it's possible to generate the string which would be used as-is in the template (in this specific case a select dropdown menu). But that's unfortunate because I want to separate view from controller. Is there a better way to achieve this?
 
You would need to do this in code using the templater_template_pre_render code event. It allows you to pass additional template params to a template (use the "Event hint" to restrict it to your specific template).
 
Top Bottom