By Adam Jackson on Wednesday, 30 October 2013
Posted in General Issues
Replies 15
Likes 0
Views 0.9K
Votes 0
Hi,

I'd like to display the data from a custom field for each user on the User List page. If I have the unique key identifier, which is 'HOMETOWN', how can I make that field display instead of Total Friends or Total Followers for each user on the User List page?

Thanks,

Adam
Hello Adam,

You would need to customize the user's list theme file which is located in /components/com_easysocial/themes/wireframe/users/default.list.php then, in one of those items that you would like to replace, you could do something like this,


$user->getFieldValue( 'HOMETOWN' );


This is considering that the HOMETOWN is the unique key for that particular field though.
·
Wednesday, 30 October 2013 01:30
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for the quick reply! I tried that...it's not working. Is the table in the database in which I find the unique key _SOCIAL_FIELDS?
·
Wednesday, 30 October 2013 01:38
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Adam,

Take a look at my screen shot here, http://screencast.com/t/jIz0zkjI3v
·
Wednesday, 30 October 2013 01:58
·
0 Likes
·
0 Votes
·
0 Comments
·
Gotcha. I had the correct unique key in my field. I've attached the screenshot of what I'm seeing after I added that code now.

I replaced the Total Followers with this code in default.list.php:

<li class="mt-5">
<i class="ies-tree-view ies-small"></i>
<?php echo $user->getFieldValue( 'HOMETOWN' );?>
</li>
·
Wednesday, 30 October 2013 02:27
·
0 Likes
·
0 Votes
·
0 Comments
·
Any ideas as to why this isn't working? Thanks for your help!
·
Wednesday, 30 October 2013 10:30
·
0 Likes
·
0 Votes
·
0 Comments
·
Ah, it looks like the textbox field doesn't have this method currently. Will try to see if we can add a workaround for this.
·
Wednesday, 30 October 2013 11:03
·
0 Likes
·
0 Votes
·
0 Comments
·
hi mark, that request from Adam would be in general a good idea for Backend Setting! if we are able to assign custom fields to userlists it would make our sites again a bit unique
·
Friday, 01 November 2013 18:24
·
0 Likes
·
0 Votes
·
0 Comments
·
Yep, this is already added into our issue tracker By the way, why would you want to assign custom fields to user lists? Not too sure if I get you here.
·
Friday, 01 November 2013 20:56
·
0 Likes
·
0 Votes
·
0 Comments
·
why i want to assign custom fields to user lists..good question mark, but it's easy to unterstand if our Custom Fields in Profile are clickable, and you can show/list easy all User with the same interests!

for example:
How did you list all User with native country Malaysia?
How did you list all User wich like to play Football or whatever?

currently it is not possible to find these User easy..because for this you would need clickable fields in Profile Info and also in User lists or Friend lists!
·
Friday, 01 November 2013 22:16
·
0 Likes
·
0 Votes
·
0 Comments
·
For example, the reason I wanted to do it was for a few fields like "Hometown", "Major", "Classification (i.e. Sophomore, Junior, Senior, etc.)"
·
Friday, 01 November 2013 22:16
·
0 Likes
·
0 Votes
·
0 Comments
·
Ah, perhaps this should really be in our search instead? Searching by fields? I am not too sure how you could include all those fields in the user list. Wouldn't that destroy the "simplicity" of the user list?

At first I did thought about adding those search by fields on the left column because it does seem like we could integrate the search on the left column (and still be user friendly too)
·
Friday, 01 November 2013 23:05
·
0 Likes
·
0 Votes
·
0 Comments
·
Ah, perhaps this should really be in our search instead? Searching by fields? I am not too sure how you could include all those fields in the user list. Wouldn't that destroy the "simplicity" of the user list?


hey mark, no it will not destroy the Userlist if we add of course only a few of our Custom fileds into the lists..see my screenshot. if the fields are added beside or under the badges info is up to you. and if a User click now on Malaysia it will show all User from Malaysia or User wich like same Music and so on..

At first I did thought about adding those search by fields on the left column because it does seem like we could integrate the search on the left column (and still be user friendly too)

this could be added additional if someone not want to add additional fields to User Lists!
·
Friday, 01 November 2013 23:45
·
0 Likes
·
0 Votes
·
0 Comments
·
Rene, we are talking about many users with different languages on the site What if your "value" is long and the text would break the layout here
·
Saturday, 02 November 2013 00:05
·
0 Likes
·
0 Votes
·
0 Comments
·
yes mark i know what you mean with value length issue but i'm sure you will find a easy solution but the current "No Badges yet" and "No Followers yet" layout looks also not very informative for other Users.

maybe a solution would be optional a one colum layout for lists if we want to show Default Custom fields in it...
·
Saturday, 02 November 2013 00:35
·
0 Likes
·
0 Votes
·
0 Comments
·
Yep, I do think that having 1 column per row would fix things up since it has more space but it also is going to defeat the "simplicity" to browse for users At a glance, I want to be able to quickly locate for users avatar without much scrolling.
·
Saturday, 02 November 2013 01:24
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post