Skip to:
Content
Pages
Categories
Search
Top
Bottom

BuddyPress Profile Tabs


  • annadito
    Participant

    @annadito

    Hi there,

    The site is a dev site so I’m not able to share a link unfortunately, but I am wondering about the best way to divide the profile field sets into tabs.

    This post here is the closest thing I can find to what I’m trying to do: https://buddypress.org/support/topic/hot-can-i-display-the-profile-fields-groups-in-tabs/

    I have downloaded the suggested plugin, but am a bit concerned about the stability and security of it since it hasn’t been updated in 4 years. I was unable to find a way to contact the developer.

    Does anyone have any ideas on how to achieve this?

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)

  • clickallco
    Participant

    @clickallco

    Could you elaborate? Currently this is an already built in function in Buddypress.

    Go to your wordpress dashboard followed by clicking on Users > Profile fields > click on the button called “Add new field group” and you got a new tab you can fill out with profile fields.


    annadito
    Participant

    @annadito

    Thanks for replying! I am able to add new field sets to the profile. They are displayed in a long list instead of broken up by tabs.

    If you’re looking at this screenshot: https://drive.google.com/file/d/1hgBbI3Za688UzVbl5cC9L5OjKboMVV5z/view?usp=sharing

    Ideally, there would be tabs under the “View Profile” text for “Bio” and “Test Field Set”. When you clicked on the tab, it would display the info associated with that field set.

    There’s an old plugin that appears to do this (https://wordpress.org/plugins/buddypress-profile-tabs/), but I am concerned about its stability and wondering if there is another option.

    Thank you for any guidance!


    annadito
    Participant

    @annadito

    Bumping in case anyone has any ideas.


    clickallco
    Participant

    @clickallco

    I see now. From looking at the plugin code it could use some cleaning up, although its still fine to use.

    If you’d like to have more control, and you know how to code, you could override the buddypress/members/single/profile/profile-loop.php (in BP Nouveau) and create a loop with tabs instead.

    It should be easily doable with js modifications or using pure CSS using radio inputs.

    Here’s an example – use the js from something like https://codepen.io/liav80/pen/KzpWzy and alter the loop in profile-loop.php (as an example) to be

    <?php if ( bp_has_profile() ) : ?>
    <div id="wrapper">
    	<?php
    	while ( bp_profile_groups() ) :
    		bp_the_profile_group();
    	?>
    		<?php if ( bp_profile_group_has_fields() ) : ?>
    			<?php bp_nouveau_xprofile_hook( 'before', 'field_content' ); ?>
    					<?php
    					while ( bp_profile_fields() ) :
    						bp_the_profile_field();
    					?>
    						<?php if ( bp_field_has_data() ) : ?>
    							<div data-tabname="<?php bp_the_profile_field_name(); ?>">
                            			<div class="tabs-inner"><?php bp_the_profile_field_value(); ?></div>
    							</div>
    						<?php endif; ?>
    						<?php bp_nouveau_xprofile_hook( '', 'field_item' ); ?>
    					<?php endwhile; ?>
    			<?php bp_nouveau_xprofile_hook( 'after', 'field_content' ); ?>
    		<?php endif; ?>
    	<?php endwhile; ?>
    	<?php bp_nouveau_xprofile_hook( '', 'field_buttons' ); ?>
    </div>
    <?php endif; ?>

    It should give you a start to change things from there.


    annadito
    Participant

    @annadito

    Thank you @clickallco! I will look into your recommendations and see if I can’t get this figured out. I really appreciate you taking the time to respond!

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar