XF 2.0 custom user field value in member card

kankan

Well-known member
Hello
I would like to display a custom user field value in the member card.
I edited the member card template.

And found this model :

Code:
<xf:if contentcheck="true">

                    <dl class="pairs pairs--inline memberTooltip-blurb">

                        <dt>{{ phrase('last_seen') }}</dt>

                        <dd dir="auto">

                            <xf:contentcheck><xf:useractivity user="$user" class="pairs--plainLabel" /></xf:contentcheck>

                        </dd>

                    </dl>

                </xf:if>

How can i rewrite this model to call the custom field value réference : {$user.customFields.FieldName}
and display its value : {xen:helper userFieldValue}

under last_seen info

Thank you.
 
I tried this :

Code:
    <dt>laptop:</dt>

                <xf:if is="{$user.customFields.asus}">

                    <dd>{$user.customFields.asus}</dd>

                </xf:if>
But the value for custom field "asus" is not displayed.
 
This seems to work:

Code:
                <xf:if contentcheck="true">
                    <div class="memberTooltip-computer">
                    <dl class="pairs pairs--inline memberTooltip-blurb">
                        <dt>Computer</dt>
                        <xf:contentcheck>
                        <xf:if is="{$user.Profile.custom_fields.asus}">
                            {$user.Profile.custom_fields.asus}
                        </xf:if>
                    </xf:contentcheck>
                    </dl>
                    </div>
                </xf:if>


Only outputs the surrounding div + dl if the user has actually selected / put in a value for the custom field.
 
Back
Top Bottom