• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Custom field value in template

dmnkhhn

Active member
#3
There is a template viewHelper (see Core.php, inside the ViewHelper directory, for the syntac) that you can use to show the value in a template. :)
 

dmnkhhn

Active member
#5
The userfieldvalue viewHelper asks for the field_id and the $user.

The syntax should be either this:
HTML:
{xen:helper userFieldValue, 'yourfieldid', $user}
or
HTML:
{xen:helper userFieldValue, yourfieldid, $user}
:)

XenForo uses this ViewHelper in the template "message_user_info".
 

Will

Active member
#6
The userfieldvalue viewHelper asks for the field_id and the $user.

The syntax should be either this:
HTML:
{xen:helper userFieldValue, 'yourfieldid', $user}
or
HTML:
{xen:helper userFieldValue, yourfieldid, $user}
:)

XenForo uses this ViewHelper in the template "message_user_info".
Can't seem to get this to work.

For example, I have this code in the template but I want to pull the value from the field to replace a space in the code.
 

dmnkhhn

Active member
#7
I am really sorry, I replied without having a working XenForo installation to verify my instructions.

Maybe a developer can comment on this? From what I see, the above snippet should work. :)
 

Will

Active member
#9