Jump to content
Sign in to follow this  
peternemser

BP Profile Search Plugin Integration into PlatformBase

Recommended Posts

peternemser

Can anyone help explain how the BP Profile Search plugin: http://buddypress.org/community/groups/bp-profile-search/ should be integrated into the PlatformBase theme? I've been able to get it to work following their very simple instructions using the PlatformPro theme but my understanding from the PageLines documentation is that it is better practice to use and customize the PlatformBase child theme. I've tried adding it to the child theme's Main Index Template (index.php) - no luck. I've also tried copying the content (all of it) of the same Main Index Template from the parent theme and pasting it into the child Main Index Template and then modifying that according to the plugin docs - again, no luck. I'm unclear as to why in this case the child theme files do not appear to override the parent. Any suggestions as to how this should be done and and advice about what the proper approach to using and customizing the child theme would be very much appreciated.

Share this post


Link to post
Share on other sites
cmunns

You can find the line you're looking for and add it to the bp-template-pack plugin under the Members directory and in index.php, BUT I already see code there for a member search ` <?php do_action( 'bp_before_directory_members_content' ) ?>

<?php bp_directory_members_search_form() ?>
` ??

Share this post


Link to post
Share on other sites
peternemser

I think I see what you're referring to and am admittedly still a little lost. The BP Compatibility appears to apply a number of php files to your current theme. That said, having run it with the PlatformBase theme chosen as the current theme the changes are only applied to PlatformPro theme. No clue why. Are the files in the PlatformBase theme supposed to match the ones in the PlaformPro theme? The PlatformBase index.php in its entirety is as follows: <?php /* This theme is Copyright © 2008-2010 Andrew Powers, PageLines.com (andrew AT pagelines DOT com) Licensed under the terms of GPL. */ // Get Control Template get_template_part( 'template.load' ); The same file for the PlatformPro on the other hand has lots of code in it: <?php get_header() ?> <div id="container"> <div id="content"> <form action="" method="post" id="members-directory-form" class="dir-form"> <h3><?php _e( 'Members Directory', 'buddypress' ) ?></h3> <?php do_action( 'bp_before_directory_members_content' ) ?> <div id="members-dir-search" class="dir-search"> <?php bp_directory_members_search_form() ?> </div><!-- #members-dir-search --> <div class="item-list-tabs">

  • <li class="selected" id="members-all">
"><?php printf( __( 'All Members (%s)', 'buddypress' ), bp_get_total_member_count() ) ?> <?php if ( is_user_logged_in() && function_exists( 'bp_get_total_friend_count' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?> <li id="members-personal">"><?php printf( __( 'My Friends (%s)', 'buddypress' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ) ?> <?php endif; ?> <?php do_action( 'bp_members_directory_member_types' ) ?> <li id="members-order-select" class="last filter"> <?php _e( 'Order By:', 'buddypress' ) ?> <select> <option value="active"><?php _e( 'Last Active', 'buddypress' ) ?></option> <option value="newest"><?php _e( 'Newest Registered', 'buddypress' ) ?></option> <?php if ( bp_is_active( 'xprofile' ) ) : ?> <option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ) ?></option> <?php endif; ?> <?php do_action( 'bp_members_directory_order_options' ) ?> </select> </div><!-- .item-list-tabs --> <div id="members-dir-list" class="members dir-list"> <?php locate_template( array( 'members/members-loop.php' ), true ) ?> </div><!-- #members-dir-list --> <?php do_action( 'bp_directory_members_content' ) ?> <?php wp_nonce_field( 'directory_members', '_wpnonce-member-filter' ) ?> <?php do_action( 'bp_after_directory_members_content' ) ?> </form><!-- #members-directory-form --> </div><!-- #content --> </div><!-- #container --> <?php locate_template( array( 'sidebar.php' ), true ) ?> <?php get_footer() ?> Is that how it is supposed to be - the child theme file is completely different? And I'm really unclear on how the child theme is supposed to be modified. I tried making changes to the child theme index.php and nothing happened. I switched back over to the parent theme and made those changes and the search works fine. Why is this? I've also tried copying the contents of the parent index.php into the child index.php (with the child theme active) but no changes I make in that file seem to have any effect. I did try making changes to other child theme files (for example the header) and those do show up. Is the index.php somehow special? A brief explanation of a proper approach to extending the PlatformPro (beyond what is in the docs) would really be appreciated. Your suggestion about making changes to the plugin is confusing. What happens when that plugin is updated? Won't those changes be lost. Isn't that the whole point of extending the PlatformPro via the PlatformBase? And the suggestion regarding editing the index.php - is that for the parent or child theme? As far as the two searches go, the one that you mentioned that is in the bp-template-pack plugin is a very simple search - one text box that searches everything. The BP Profile Search plugin on the other hand allows the user to search by each of the user profile fields - in some cases much more useful and of course why I'd like the option to use it.

Share this post


Link to post
Share on other sites
peternemser

I've read through the post you linked to and unless I'm missing the boat (please correct me if I am - I'm new to this framework) I'm pretty sure this is a PageLines problem, not a BuddyPress problem. To recap as simply as possible, the instructions from the BP Profile Search plugin are as follows: If you are using the BuddyPress default theme, open index.php in the buddypress/bp-themes/bp-default/members folder, locate this line (line 14): </div><!-- #members-dir-search --> and, right after that, insert the BP Profile Search form: <?php do_action ('bp_profile_search_form'); ?> If you are not using the BuddyPress default theme, you have to insert the BP Profile Search form somewhere in your theme Members page. That's it. And it works just fine if I use/modify the index.php from the PlatformPro theme (and make that theme active). It does not work if I use/modify the index.php from the PlatformBase theme (and make that theme active) - whether I add it to the very limited code that appears by default in that file or if I copy the content of the Pro file of the same name into the Base file and then insert the one new line as instructed. In short, the parent/child relationship (in particular the child overriding the parent) does not appear to be working for the index.php (though as I've noted in a previous post it seems to work for other Base files). My question is, of course, why?

Share this post


Link to post
Share on other sites
cmunns

While editing the plugin is not the best solution it does make the most sense since that is actually where the buddypress files are coming from in this case. As opposed to PlatformPro having a separate theme dedicated to BuddyPress as other BuddyPress themes are it uses the bp-template-pack to integrate via a plugin and thus you won't even find an index.php inside of any member directory in PlatformPro

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×