BuddyDev

Search

[Resolved] Possibility to match other binary value (e.g. man matches female)

  • Participant
    CapCa on #12914

    Hey,

    I am currently working with buddypress and in my current project, there is one use-case I can’t realize:
    The users of my systems have to sign up as a certain role. Example:
    – if the user selected that he is a client, then only users which selected that they are helpers will be shown
    – for users that selected caretakers vise versa

    Currently, this is only possible with two fields (“I am a:” and “I am looking for a”). But is it possible to combine them only in one field because if a user selected a special role, then I know that the user is only searching for a specific role (e.g. as a client only caretakers are intersting).

    My current approach would be that I create two fields, hide one of them (I am searching for a XXX) and update this field if the first field changes (e.g. user selects “client” and second field value is then “helper”). But this is really hacky and I am searching for a better option to handle this. Do you have any idea how to implement this?

    Thank you

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #12917

    Hi CapCa,
    Welcome to BuddyDev.

    In your case, member types seems to be a much better option. Use member types to create mutually exclusive groups of users and then you can use xprofile_query to easily display the list of users from the complementry type based on the current user’s member type.

    Your approach for creating a normal profile field with the options will work too but won’t be as efficient as using member type in this case.

    Bets Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #29507

    Marking resolved due to lack to reply.

The topic ‘ [Resolved] Possibility to match other binary value (e.g. man matches female)’ is closed to new replies.

This topic is: resolved