Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

Profile fields in members list on groups page (5 posts)

Started 7 months, 3 weeks ago by: kirkslater

  • Hi

    On the list of users I have as members on a group, is there a way to retrieve xprofile fields and display them? So that I can have there location next to their name?

    I use the following in the members loop but it doesn’t work on the groups page:

    <?php if ( $location = xprofile_get_field_data('Location') ) : ?>
    <?php echo $location ?>
    <?php endif; ?>

    Any ideas?

  • Profile picture of Brajesh Singh Brajesh Singh said 7 months, 3 weeks ago:

    Try this

    <?php $location = xprofile_get_field_data('Location', bp_get_group_member_id());
    if(!empty($location)) : ?>
    <?php echo $location ?>
    <?php endif; ?>

    just pass bp_get_group_member_id() as the second parameter to xprofile_get_field_data.

  • @sbrajesh worked perfectly many thanks

    Could I be a pain and ask you to take a look over this issue as well? If not, no worries ;)

    http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/display-age-on-profile-page/

  • Profile picture of Brajesh Singh Brajesh Singh said 7 months, 3 weeks ago:

    @kirkslater,
    you are most welcome. Checking that thread in a minute :)

  • Profile picture of Quint Quint said 7 months, 3 weeks ago:

    @kirkslater, nice idea! I hope you don’t mind me piggy backing off your post but your idea brought a related one to mind.

    @sbrajesh, thanks for planting the seed. Is the following possible? Whether viewing the group or member directory, could the div for the list item; that is the row that contains the group or member, be made into a link that on hover, activates a tool tip that contains group or member profile data? And I’m not referring to hover over the existing member name link; since, in my opinion, this would require the user aim their cursor at a small defined space rather than the “acreage” a row represents.

    The purpose behind the request is “context”. When looking at a list of members or groups, having the user click on the link for them to find out the details behind the member or group is wasteful and time-consuming. This is why kirkslater’s idea is so intriguing.