Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Dividing xprofile fields into groups in the profile-loop ?


John James Jacoby
Keymaster

@johnjamesjacoby

I think to do this correctly, your loop will need a few more logic checks and error traps in the event that all of the info under a tab may be totally empty, or that some of the fields are empty and others are not. This might not be a problem if all of the fields are required, but you’ll need to modify the idea to taste. Example would be taking…

<?php if ( bp_field_has_data() ) : ?> …and displaying something if the field actually is empty. Same with <?php if ( bp_profile_group_has_fields() ) : ?>

I’d also check around the web for a lightweight JavaScript tab library, or do a quick Google for jQuery tabs and use the jQuery library that comes bundled with WP, and then follow the examples. I know there’s a few that just wrap the tabbed content in a container div and use an H3 or some other logical element as the clickable “tab.”

Otherwise the code above should be sufficient to output the profile data into tables, you just need to find the engine to make your tabs go.

Skip to toolbar