Consider a template hook such as this:
And my template that looks like this:
The problem is here, the member_card_stats hook can't pass either the user or visitor params to the template.
I can handle this partially by adding the following to my hook:
This definitely (I have tested) passes the visitor params to the template.
What do I do to also pass the user params to the template?
I was able to get the user params working by adding:
But I can't get them working together. I need to be able to pass both user and visitor params - what am I missing?
Thanks
PHP:
if ($hookName == 'member_card_stats')
{
$contents .= $template->create('myTemplate_member_card', $hookParams);
}
And my template that looks like this:
HTML:
<xen:if is="{$user.customFields.myPreference} == 'show' AND {$visitor.user_id}">
<dl class="pairsInline">
<dt>{xen:phrase content}:</dt>
<dd>{xen:string censor, $user.myContent}</dd>
</dl>
</xen:if>
The problem is here, the member_card_stats hook can't pass either the user or visitor params to the template.
I can handle this partially by adding the following to my hook:
PHP:
$hookParams['visitor'] = XenForo_Visitor::getInstance();
This definitely (I have tested) passes the visitor params to the template.
What do I do to also pass the user params to the template?
I was able to get the user params working by adding:
PHP:
$hookParams['user'] = XenForo_Visitor::getInstance();
But I can't get them working together. I need to be able to pass both user and visitor params - what am I missing?
Thanks