Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to filter the members directory by XProfile Fields


  • ch1n3s3b0y
    Participant

    @ch1n3s3b0y

    Hi

    I’ve found a number of BuddyPress search plugins, but nothing that seems to filter members by their XProfile fields. I’m looking to create an AJAX filter so users can refine the list of users on the page without having to reload everything. Any pointers on how to do this or any posts you know of where someone has already done this?

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

  • somethingelse
    Participant

    @somethingelse

    ^+1 wow, i totally need this too… DESPERATELY.

    if i had realized just how difficult this was going to be to accomplish,i never would have started this project with buddypress. what is the point of xprofile fields if they are not easily searchable?

    there are so many GREAT things about buddypress, it’s super frustrating that this thing which seems to straightforward is so challenging.

    i have been searching … the “buddypress profile search” plugin is not the answer… it isn’t user friendly enough. I just want one search box – “find a teacher in your city” that will search 4 xprofile fields of all our teachers… ONLY THOSE FOUR FIELDS… and return the results.

    i’ve tried a google site-search tool, too…
    the trouble is that our teachers have bios, and in those bios they often include cities where they have trained, or toured, and we do NOT want those included in the “Find a teacher” results.

    i have Base City, and 3 “additional teaching locations” fields… those, and NAME, are the ONLY fields i want searchable.

    i can pay for help.
    but i figured this would be something simple i could do myself!


    peter-hamilton
    Participant

    @peter-hamilton

    This might help you, dont know myself but looks like it is adjustable to do what you need.

    Xprofile search


    AdventureRidingNZ
    Participant

    @adventureridingnz

    Add me to the list. I want to be able to have a page with a members list which lists 6 xprofile fields if a particular one of those fields is populated.


    Onlineplaner
    Participant

    @radair2002

    Hi all,

    any news to this one?

    Kind regards

    Rolf


    Earl_D
    Participant

    @earl_d

    It doesn’t set up predefined filters which seems like what OP wanted but this works really well for me and includes widget

    https://wordpress.org/plugins/bp-profile-search/


    Lars Henriksen
    Participant

    @adjunkten

    One solution might be to simply display the xprofile fields, that you want to be searcable in the member directory.
    Then you can simply use the member search form to search for xprofile content.

    My members have a field with ‘school’ http://historielaerer.dk/medlemmer/

    This snippet adds two profile fields to the members loop – add the code to your bp-custom.php:

    <?php
    function add_info_to_members_loop() {
        $field_content = bp_get_member_profile_data( 'field=(Xprofile Field name)' );
        if( $field_content != false )
          echo "(label for xprofile field content): " . $field_content;
        $field_content = bp_get_member_profile_data( 'field=(Xprofile field name #2' );
        if( $field_content != false )
          echo "<br/>" . $field_content;
    }
    add_action( 'bp_directory_members_item', 'add_info_to_members_loop' );
    
    ?>

    Just an idea.

    Kind regards, Lars

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Skip to toolbar