XF 1.5 Custom user field in place of user title

Nauman

Member
I wish to replace the user title appearing below the avatar with values selected in a check box custom field. I have created a new custom field called qualification status as follows:
upload_2016-11-20_22-8-26.webp

Right now one option is selected so that should appear in place of user title. However, if two or three (e.g ACA, FCA and ACCA) were to be selected it should appear like:

ACA, FCA, ACCA
 
I have commented out the user title bit from message_user_info template and put this code instead:
Code:
<xen:if is="@messageShowCustomFields AND {$user.customFields}">
            <xen:hook name="message_user_info_custom_fields" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">

                <xen:foreach loop="$userFieldsInfo" key="$fieldId" value="$fieldInfo">
                    <xen:if is="{$fieldInfo.viewable_message} AND ({$fieldInfo.display_group} != 'contact' OR {$user.allow_view_identities} == 'everyone' OR ({$user.allow_view_identities} == 'members' AND {$visitor.user_id}))">
                        <xen:if hascontent="true">
                            <dl class="pairsJustified userField_{$fieldId}">
                                <dt>{xen:helper userFieldTitle, $fieldId}:</dt>
                                <dd><xen:contentcheck>{xen:helper userFieldValue, $fieldInfo, $user, {$user.customFields.{$fieldId}}}</xen:contentcheck></dd>
                            </dl>
                        </xen:if>
                    </xen:if>
                </xen:foreach>

            </xen:hook>
            </xen:if>,

As a result the output is as follows:

upload_2016-11-22_21-18-10.webp

How do I remove the custom field name from here? I want to just show the field info there.
 
Made a few more changes and have removed this line

Code:
<dt>{xen:helper userFieldTitle, $fieldId}:</dt>

Now I have ended up with:

upload_2016-11-22_21-24-9.webp

How do I remove the space before ACA?
 
I removed the following:

Code:
class="pairsJustified userField_{$fieldId}"

from the dl tags. It seems to have fixed the problem. Can anyone tell me if this would cause any other issues?
 
Top Bottom