Support » Plugin: BP Profile Search » Display xProfile fields in custom directory results?

  • Resolved bdd

    (@bws-online)


    I have a basic custom directory set up.

    I’m filtering it to show the members I want to show — I want to show the ones who have filled in a particular field in their member profile, so I’m using a “like” filter with a “%” being what I want to match.

    What I’d like to do now is customize the results to show particular xProfile fields for those matched members.

    Can you direct me to anything to help with this?

    I’ve tried some of what I’d seen here but haven’t gotten it to work just yet: Display single xprofile fields

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • bdd

    (@bws-online)

    Nevermind, figured it out!

    From Using Custom Profile Field Data in Buddypress Templates

    While in the members loop, you can use the included function: ‘bp_member_profile_data( ‘field=the field name’ )’ to much the same effect.

    Don’t know why it was so difficult to track down this info — maybe I missed it somewhere in my bleary-eyed state. 🙂

    Plugin Author Andrea Tarantini

    (@dontdream)

    Hello bdd,

    The Custom Directories documentation is not updated yet, but you can display profile fields in your custom directory using the show attribute:

    [bps_directory show='field_4,field_36']

    as explained in BP Profile Search 5.0.2.

    bdd

    (@bws-online)

    Thanks, good to know. Wish I’d known sooner! But actually this wouldn’t have been an exact fit for my needs, as I want to show the name of a link linked to a URL (rather than showing separate name and URL fields). Doesn’t seem like it would be possible to do that with this attribute — would it?

    Plugin Author Andrea Tarantini

    (@dontdream)

    I guess you can try the shortcode, and if you don’t get what you need you can use the ‘bp_directory_members_item’ hook or you can make a custom directory template.

    To use the hook:

    add_action ('bp_directory_members_item', 'display_details');
    function display_details ()
    {
        // display your user details here
    }

    While to make a custom directory template, see Custom Directories, bullets E) and F).

    bdd

    (@bws-online)

    How does using the hook differ from making a custom directory template?

    (Given what I want to do, I think I’ll need a custom directory template anyway.)

    Plugin Author Andrea Tarantini

    (@dontdream)

    The above hook simply allows you to add one or more lines to a member’s directory entry, with the custom template you can do the same and, additionally, you can fully customize every aspect of your members directory page.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Display xProfile fields in custom directory results?’ is closed to new replies.