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

XF 1.3 Member List vs Search Results (custom field not returned)

Discussion in 'Styling and Customization Questions' started by lmnop, Mar 2, 2015.

  1. lmnop

    lmnop Member

    I've been poking around in the XF forums and on our forum templates for several hours and have not been able to solve this mystery.

    I've been successful in adding a custom filed (full name), a "Start a Conversation" button and some dates - to the member list page by editing the member_list_item template.

    Screen Shot 2015-03-01 at 4.35.42 PM.png

    However, when I search for users at "Brandeis University" ( or another field) you'll notice that the person's full name no longer shows up.
    Screen Shot 2015-03-01 at 4.38.02 PM.png

    Am I missing a coding phrase for this custom field? Am I putting the code in the wrong place? I've gotten pretty good at looking at examples on XF and working them in to my own templates, but now I'm at a total loss.

    Thanks for any help!
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Custom user fields are not searchable as they aren't indexed.

    Unless I have misunderstood what it is you are trying to do?
  3. AndyB

    AndyB Well-Known Member

  4. lmnop

    lmnop Member

    I'm using the Advanced Member Profile Search add-on as the search form. If I search in the city field (not custom and I've changed the phrase from "city" to "host site"), I get a list of results that look similar to the member list, except that the person's full name (a custom field) is not appearing. I'm just not understanding why it disappeared. What's the difference between the full member list and the search return list in terms of custom field visibility?
    Screen Shot 2015-03-01 at 5.05.36 PM.png
  5. lmnop

    lmnop Member

    I have your add-on installed, but it is limited for our use. I do like how the results are returned, but some of our fields have more than one choice and your add-on doesn't support radio buttons or pull down lists. Thanks.
  6. Brogan

    Brogan XenForo Moderator Staff Member

    They are different templates.

    You would need to edit the search results template to display the custom field information.
  7. lmnop

    lmnop Member

    Thank you.
    Now that I know the correct template, I'm still having trouble figuring out where to put the code or even if my code is correct. This is what I used for the member list page:
    <div class="userInfo">{xen:helper userFieldValue, $userFieldsInfo.name, $user, {$user.customFields.name}}</div>

    1. Is this correct? If not what code should I use?
    2. Where exactly should it go in the search_results template

    As always, help and guidance is much appreciated! M
    Screen Shot 2015-03-02 at 7.38.55 AM.png
  8. Brogan

    Brogan XenForo Moderator Staff Member

    It's possible the variables aren't exposed to that template.

    You can check by dumping {xen:helper dump, $search.users} in the template, just above the sidebar
  9. lmnop

    lmnop Member

    If you mean by dumping, adding the code: {xen:helper dump, $search.users} above <xen:sidebar>
    It had no impact. :-(
    Thanks, M

Share This Page