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

XF 1.3 Conditional in custom fields display order

ibaker

Well-known member
#1
I have 2 custom fields:
1. Specialty
2. Country

In message_user_info I want to move the default user "Location" field and have it displayed between the two custom fields but can't seem to get the condition correct...as in display the "Location" field before the Country field.

The code I thought would work but doesn't is to simply move the "Location" block of code in the message_user_info template further down the template placing it inside the Custom Fields block of code and within a condition to display the "Location" field only if the field in the loop is the Country custom field:

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="{$visitor.customFields.636f756e747279}">
                        <xen:if is="@messageShowLocation AND {$user.location}">
                            <dl class="pairsJustified">
                                <dt>{xen:phrase location}:</dt>
                                <dd><a href="{xen:link 'misc/location-info', '', 'location={xen:string censor, $user.location, '-'}'}" target="_blank" rel="nofollow" itemprop="address" class="concealed">{xen:string censor, $user.location}</a></dd>
                            </dl>
                        </xen:if>
                    </xen:if>


                    <xen:if is="{$fieldInfo.viewable_message}">
                        <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>
Can anyone help with this...thanks