• 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)

#1
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!
M
 

Brogan

XenForo moderator
Staff member
#2
Custom user fields are not searchable as they aren't indexed.

Unless I have misunderstood what it is you are trying to do?
 
#4
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
 

Brogan

XenForo moderator
Staff member
#6
What's the difference between the full member list and the search return list in terms of custom field visibility?
They are different templates.

You would need to edit the search results template to display the custom field information.
 
#7
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
 

Brogan

XenForo moderator
Staff member
#8
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
If you mean by dumping, adding the code: {xen:helper dump, $search.users} above <xen:sidebar>
It had no impact. :-(
Thanks, M