bambua
Well-known member
I'm working on an update for my addon, and i'm trying to make use of the template hooks so that it doesn't require any edits by the user to get it to show up.
I've figure out how to make the code listener work and thanks to a few of the posts on here what needs to be in the listener. What can't figure out is how to tell it to render another template, right now here is what I have:
What it does is just put that xen:include portion straight into the html, so it looks like it doesn't actually render it after it's sent to the hook function. Reading a bit deeper this is expected.
Does anyone know a function/class I can call within XF to get a rendered version of my recent_status template?
Thanks in advance!
I've figure out how to make the code listener work and thanks to a few of the posts on here what needs to be in the listener. What can't figure out is how to tell it to render another template, right now here is what I have:
Code:
class RecentStatus_Listener_TemplateHook
{
public static function template_hook($name, &$contents, array $params, XenForo_Template_Abstract $template)
{
// Choose the hook you want to manipulate
if ($name === 'forum_list_sidebar')
{
// Change the value of $contents in any way you want
$contents .= "<xen:include template=\"recent_status\"></xen:include>";
}
}
}
What it does is just put that xen:include portion straight into the html, so it looks like it doesn't actually render it after it's sent to the hook function. Reading a bit deeper this is expected.
Does anyone know a function/class I can call within XF to get a rendered version of my recent_status template?
Thanks in advance!