BP Profile Search › Search of fields in hidden profile group
-
AuthorPost
-
Phil
GuestHey guys,
I’ve recently found out how I can move profile groups into a separate tab of my buddypress member’s profiles. This is quite useful to make the profiles easier to view. However, when I then hide the profile group in the actual profile view, BP Profile Search doesn’t see the fields anymore and thus the search doesn’t work/search field disappears.
To hide the profile group, I’m using the following code:
function hide_profile_group( $grpid ) { if ( !bp_is_profile_edit() ) { $myfield = xprofile_get_field_data( 'Critical Review' ); $grpid['exclude_groups'] = '3'; } return $grpid; } add_filter( 'bp_after_has_profile_parse_args', 'hide_profile_group' );Any idea how I could accomplish both: Hide the profile group while still allow for the search to work?
Thanks so much in advance 🙂
andrea
Plugin AuthorHi Phil,
You could try to remove your custom code, and hide the group fields using the setting Visibility = Only Me in each field’s edit page.
Phil
GuestHey Andrea,
well, then the fields are also not visible in the separate tab that created for the profile group and thus not really what I would need. Any other ideas?
Kind regards,
Philipandrea
Plugin AuthorHi Phil,
Where do you wish to show your field group, and where to hide it? From your code, I understand you wish to hide it everywhere except on the profile edit page, is that correct?
Phil
GuestRight. If you look here: https://fslci.org/members/philip-strothmann/criticalreview/ You’ll see, that currently the profile group is displayed twice, once in the actual standard profile and once in the “critical review” tab. With the code above, I can hide it in the standard profile – unless it is edited – so it isn’t showing up twice, but then the search function stops working. Hence I’m not hiding it with the code snippet above for the moment and look for a way to achieve both, hide it but keep it searchable.
Kind regards,
Philipandrea
Plugin AuthorCould you make separate tabs for all the profile groups, including the Base group (Personal Profile), and remove the standard profile tab altogether?
Or you could make a custom template for the standard profile tab, and make it show the Base group only.
Phil
GuestOk, so just to get this right: Your idea is to put all groups into new tabs and then instead of hiding the profile group, hide the standard profile tab, right? That could work.
Phil
GuestWell, thinking further about this idea, I would then also need to take care of the profile edit, the profile picture and the profile cover image subnav of the standard profile, which might complicate things. But maybe this could still work, if I introduce a condition that the new standard profile tab is only seen by other users, and the old one where I still have the subnavigation remains only visible if the user looks at his own profile?
Phil
GuestAh, just saw the custom template idea, that might be an easier way to accomplish the same. Thanks for the suggestions, I’ll look into it 🙂
andrea
Plugin AuthorYou are welcome! And I agree with you, probably the custom template is the simplest way to go.
-
AuthorPost