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

XF 1.3 RE: Custom User Fields in Postbit [message_user_info]

Discussion in 'XenForo Questions and Support' started by MsJacquiiC, Oct 21, 2014.

  1. MsJacquiiC

    MsJacquiiC Well-Known Member

    I've created a few custom user fields and have added them to the message_user_info template as to populate the postbit with searchable fields. Here's the result:


    The underlined links above are the actual field values. I made all field values lowercase when creating the fields. But what I want to show in the spot here is the actual formfield values:



    For instance - "tennessee" becomes Tennessee with capitalization intact.
    And "postop" becomes Post-op with capitalization and the hyphen intact.

    Here's the code I'm currently using in message_user_info

    <xen:if hascontent="true">
                <dl class="pairsJustified userField_surgerylocationstate xbCustomField">
                    <xen:if is="{$user.customFields.surgerylocationstate}">
                        <a class="Tooltip concealed" title="Surgery Location" href="members/searchlist?some_field={$user.customFields.surgerylocationstate}&field_type=surgerylocationstate"><dt><i class="fa fa-hospital-o" data-offsetx="-6" data-offsety="0"></i></dt>
                                <dl class="clearFix"></dl>
    Can someone please tell me which part of the code above I need to change in order to get the desired effect please? Much appreciation for the assistance!

  2. Brogan

    Brogan XenForo Moderator Staff Member

    I may be missing something, but are you manually editing the template to add the custom fields?

    There is an SP which you can check to do that.


    Then you enter the text you want to display in the HTML field.

    MsJacquiiC likes this.
  3. MsJacquiiC

    MsJacquiiC Well-Known Member

    Hey Brogan and thanks for the reply.
    I am indeed manually editing the template. The reason is because the default styling/code is a bit different from the layout I'm aiming for.
    I think I'm close to achieving the look I want. But this bit of code...

    ... only shows the field values.
    Is there a code to show the actual formfield -- with spelling, case & capitalization intact -- as it does on say the registration form?

  4. Mike

    Mike XenForo Developer Staff Member

    {xen:helper userFieldValue, $userFieldsInfo.fieldName, $user, $user.customFields.fieldName}
    Change fieldName in both places as necessary.
    MsJacquiiC likes this.
  5. MsJacquiiC

    MsJacquiiC Well-Known Member

    That did it. Thanks so much Mike [​IMG]


Share This Page