Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author BuddyBoss

    (@buddyboss)

    Hi @gooly,
    You can override them inside child theme at following path
    Like id have did for results-page-content.php tempalte file.

    child-theme-folder/buddypress-global-search/results-page-content.php

    Can you override the individual sub templates?

    e.g.

    child-theme-folder/buddypress-global-search/templates/loop/member-ajax.php
    child-theme-folder/buddypress-global-search/templates/loop/member.php

    I want to add extra info into the members search.

    However it doesn’t appear to be working.

    It looks like there is provision for this as the template file includes some code that is commented out:

            <?php
             /***
              * If you want to show specific profile fields here you can,
              * but it'll add an extra query for each member in the loop
              * (only one regardless of the number of fields you show):
              *
              * bp_member_profile_data( 'field=the field name' );
              */
            ?>

    I was able to get this working using template overrides at the following paths:

    child-theme-folder/buddypress-global-search/loop/member-ajax.php
    child-theme-folder/buddypress-global-search/loop/member.php

    (You don’t need to include the ‘templates’ folder.)

    My code to add extra info to the members template is like:

    		<div class="item-desc">
    			<?php
    			if(xprofile_get_field_data( 'Phone', bp_get_member_user_id() )) {
    				echo '<strong>Phone:</strong> ' . xprofile_get_field_data( 'Phone', bp_get_member_user_id());
    			}
    			if(xprofile_get_field_data( 'Phone', bp_get_member_user_id() )) {
    				echo '<br /><strong>Email:</strong> <a href="mailto:' . xprofile_get_field_data( 'Email', bp_get_member_user_id()) .'">' . xprofile_get_field_data( 'Email', bp_get_member_user_id()) . '</a>';
    			}
    			?>
    		</div> 

    e.g.

    xprofile_get_field_data( ‘X_PROFILE_FIELD_NAME_HERE’, bp_get_member_user_id())

    Plugin Author BuddyBoss

    (@buddyboss)

    Cool

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can I override templates’ is closed to new replies.