BuddyDev

Search

[Resolved] Trying to make member profile pages according to member types … plz help!


  • Participant
    Level: Initiated
    Posts: 15
    Mical Johnson on #27697

    Hi Brajesh,

    We love your Member Type Pro plugin and it’s working awesomely!! I was trying to make different profile pages according to Member Types that I created using your plugin. According to the Codex page all I had to do is to put a front.php file under /buddypress/members/single/ folder like this …

    /buddypress/members/single/front-member-type-{member-type}.php

    I did exactly that with no luck. Even put a front.php file to check if that works. But still no luck … Is the Codex wrong? Did they change anything? Cannot find any answer anywhere … I’m looking for help here only cuz you seem to know your stuff and you answer pretty quickly. I feel like I’m pretty close but there is no help on the topic anywhere … I’d really appreciate if you could help us with some directions … Thanx in advance.

    Moose


  • Keymaster
    (BuddyDev Team)
    Posts: 16429
    Brajesh Singh on #27717

    Hi Moose
    Thank you for the question.

    To answer your question.

    1. The front template for member type works, but it is not what you are expecting. The front template is used to show the contents inside the content area(below the member header where you see activity etc)

    2. If your goal is to completely control the profile page layout by member type, we can easily do it by forcing bp to load our own template if exists.

    
    add_filter( 'bp_template_hierarchy_members_single_item', function ( $templates ) {
    
    	$member_types = bp_get_member_type( bp_displayed_user_id(), false );
    	foreach ( $member_types as $member_type ) {
    		array_unshift( $templates, "members/single/index-type-{$member_type}.php" );
    	}
    
    	return $templates;
    } );
    
    

    Now, you can create buddypress/members/single/index-type-somemembertype.php and that will be the one used for whole page(You will need to include headers/footers etc manually here).

    Regards
    Brajesh


  • Participant
    Level: Initiated
    Posts: 15
    Mical Johnson on #27729

    Thank you very much Brajesh! You da maaaaan!! … I’ll try this out asap … You have no idea how greatful I am for this. There is no good help out there when it comes to BP customization. God bless!

    Moose.

You must be logged in to reply to this topic.

This topic is: resolved
Subscribe