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:

    bf_message_user_info.png

    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:

    bf_message_user_info2.png

    bf_message_user_info3.png

    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

    Code:
    <xen:if hascontent="true">
                <dl class="pairsJustified userField_surgerylocationstate xbCustomField">
                <xen:contentcheck>
                    <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>
                        <dd>{$user.customFields.surgerylocationstate}</dd></a>
                    </xen:if>
                </xen:contentcheck>
                </dl>
                                <dl class="clearFix"></dl>
    </xen:if>
    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!

    J
     
  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.

    upload_2014-10-21_9-39-25.png

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

    upload_2014-10-21_9-42-13.png
     
    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...

    Code:
    {$user.customFields.surgerylocationstate}
    ... 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?

    BF-custom-profiel-fields3.gif
     
  4. Mike

    Mike XenForo Developer Staff Member

    Try:
    Code:
    {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

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

    J.
     

Share This Page