This topic has 3 replies, 2 voices, and was last updated 9 years by Laurent_C.

  • Author
  • #70271
     Laurent_C
    Participant

    BuddyPress 2.2 introduced the concept of member types. BuddyPress itself does not register any member types.
    Plugins and themes can register member types using the bp_register_member_type() or the bp_register_member_types() function:

    More info here: https://codex.buddypress.org/developer/member-types/

    It would be nice to have this incorporated into Kleo theme.
    A good examples of its use would be for profile field groups.
    Where you could assign specific profile field groups to member types.

    #70387
     sharmstr
    Moderator

    Its been done with a plugin: http://buddydev.com/plugins/conditional-profile-fields-for-buddypress/ At the field level at least.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #70402
     sharmstr
    Moderator

    There’s a Member Type Register plugin as well: https://wordpress.org/plugins/bp-member-type-generator/

    I was playing around with displaying profile groups depending on the member type. This is by no means a complete solution, but perhaps will give you some insight on how this can be done. I used the above plugin to register 2 members types; Student and Teacher. Then in xprofile I created two new profile groups. Again, Student and Teacher. In the profile template (/kleo/buddypress/members/single/profile-loop.php), I added a conditional check to only display the base group and the profile group of the displayed users member type. The condition code is

    COPY CODE
    
    if ( ( bp_get_the_profile_group_name() == 'Base' ) or ( strcasecmp(bp_get_the_profile_group_name(), bp_get_member_type($bp->displayed_user->id)) == 0 ) )
    

    It basically compares the name of the current profile group during the looping process to the members type name. See attached for complete code (I added 3 lines with the comment ‘added’. Lines 1, 7 and 51).

    Again, this is not a complete solution since you’d have to do the same with the registration form and the profile edit screens.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    Attachments:
    You must be logged in to view attached files.
    #70454
     Laurent_C
    Participant

    Thank you very much Sharmstr !
    I read the code but how can I do to make it works with 3 kind of profile ? can you elaborate a bit more to help me do the 3 kind of profile.
    And to fill the form,
    I dont understand the way to hide each group for the feeding, thank you

Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘Feature requests’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?