Steve F
Well-known member
I see in ViewPublic/Member.php the custom fields function. How can I take this and extend it to my template for my add-on, more specifically the template is used in the message user info and member card to display a users Identity (Gamer Tags) but I need this to abide by a users privacy settings.
I see this in Member.php
Then is set
Passed to the template (member_view)
I can use this on the member_view page easily enough (as it is passed default to member_view) to do what it needs to but I need the same for my template.
I see this in Member.php
PHP:
$customFieldsGrouped = $fieldModel->groupUserFields($customFields);
if (!$userProfileModel->canViewIdentities($user))
{
$customFieldsGrouped['contact'] = array();
}
Then is set
Code:
'customFieldsGrouped' => $customFieldsGrouped,
Passed to the template (member_view)
Code:
return $this->responseView('XenForo_ViewPublic_Member_View', 'member_view', $viewParams);
I can use this on the member_view page easily enough (as it is passed default to member_view) to do what it needs to but I need the same for my template.
Code:
<xen:if is="{$customFieldsGrouped.contact}">
CONTENT
</xen:if>