Custom field value in template

Will

Active member
I want to pull a custom field value in a template. What could I use to achieve this?
 

dmnkhhn

Active member
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. :)
 

Will

Active member
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. :)
Thanks for that.

Do you know how I can pull a value from a specific field?
 

dmnkhhn

Active member
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
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
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
Top