-
Author
-
July 27, 2015 at 17:24 #70271Laurent_CParticipant
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.July 28, 2015 at 14:10 #70387sharmstrModeratorIts 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 solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
July 28, 2015 at 15:41 #70402sharmstrModeratorThere’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 CODEif ( ( 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 solutionThis 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.July 28, 2015 at 20:35 #70454Laurent_CParticipantThank 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 -
AuthorPosts
The forum ‘Feature requests’ is closed to new topics and replies.