XF 2.0 Display custom user fields under username/avatar

Is there a way to display custom user fields under their username/avatar? I'd like to display one custom user field here (first name).

Thanks,
Pete
 
In the template message_macros, after
<xf:if is="{$dateHtml}"><div class="message-date">{$dateHtml}</div></xf:if>
insert
{$user.Profile.custom_fields.yourcustomfieldname}
Style it as you see fit.
 
@S Thomas
I have added this code to the template message_macros, as suggested above:

Code:
                <div style="color:#2f4456; font-size:70%;">
                    First Name:<b> {$user.Profile.custom_fields.first_name}</b>
                    </div>
                <div style="color:#2f4456; font-size:70%;">
                    Model:<b> {$user.Profile.custom_fields.my_willys_is_a}</b>
                    </div>
                <div style="color:#2f4456; font-size:70%;">
                    Year:<b> {$user.Profile.custom_fields.the_year_of_my_willys_is}</b>
                    </div>

The first line of code works, and pulls the user's first name.
The second and third lines only display "array" instead of pulling from the database.

What am I missing? Again, I'm new to this stuff, fumbling my way through...

Thanks,
Pete
 
Last edited:
The template variables and functions are tightly bound to the source code of XF. You would need to understand that in the first stance to utilize templates to their maximum.

What kind of custom field are the other 2? I suppose the first is a single-line text input.
 
Am I missing here something or why didnt you use ACP->Appearance->Styles->Your Style->Style Properties->Messages->Message User Info Elements->Custom Fields


It says it in Custom User Fields
View attachment 181124
I turned this on, and it shows the custom user fields in the about section of a user's profile, but doesn't show the fields under their avatar. I'm just wanting to display three of the custom fields I have, in this location.
Thanks,
Pete
 
In the custom field activate this:
42989735365_590bbd2b30_o.png

Then go to Appearance -> Styles -> Your Style -> Style properties -> Messages
and tick this:
42085215030_f743186dd6_o.png
 
Top Bottom