By Bethany Amborn on Thursday, 13 November 2014
Posted in Technical Issues
Replies 3
Likes 0
Views 794
Votes 0
How would I go about adding profile field values to return in the search results next to the user image? For example, I have a custom field on the profile called "Status" that has values like "Available", "Just Looking," etc. I want that status to show up on the search results so people can scroll through and find what they need.

Can you point me in the direction of 1) which files i would modify in an override and 2) an example of the syntax to return a field value?
Hello Beth,

I am sorry for the delay of this reply.

To display the value of a custom field for a user, you can try the below code:



// to get the user object of user id 123
$user = FD::user('123');

// to retrieve the value of the field with unique_key of 'FIELD_STATUS' and output the value.
echo $user->getFieldValue('FIELD_STATUS');


You can place the value output code in this file 'JOOMLA/components/com_easysocial/themes/wireframe/advancedsearch/user/default.results.item.php' at line after 52. E.g.


<li class="item-friend">
<?php echo $user->getFieldValue('FIELD_STATUS'); ?>
</li>


Please see http://screen.stackideas.com/2014-11-13_1324.png

Hope this help and have a nice day!
Sam
·
Thursday, 13 November 2014 13:24
·
0 Likes
·
0 Votes
·
0 Comments
·
Sam, just a quick call...

Is Browse user only a shorter method call (or simpler) of advance search thus changing advance search will also use browse user ?
·
Thursday, 13 November 2014 14:25
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Alex,

Nope, there are not the same You need to modify this theme file if you want to include custom field value for the user.

JOOMLA/components/com_easysocial/themes/wireframe/users/default.list.php

The method to display field value will be the same
Sam
·
Thursday, 13 November 2014 15:26
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post