BP Project Framework: A Boilerplate for Custom BuddyPress Projects

buddypress-wall

Developers who are new to BuddyPress sometimes find BP templates confusing to work with. Common questions include: Why are there so many? Where do I place the files? How can I override the templates in my project?

BP Project Framework is a plugin from the folks at WebDevStudios that provides a boilerplate for new custom BuddyPress projects. Essentially, it adds all the BuddyPress templates you need in the convenience of a plugin.

BuddyPress has included WordPress theme compatibility since version 1.7, which means that you can activate the plugin and it will work with nearly any theme. However, if you want to customize BuddyPress-specific features, you will need to override the BP templates. Ordinarily, you would copy those templates from the BuddyPress plugin folder into your theme folder. BP Project Framework allows you to skip this step by creating a new template stack.

The plugin includes all of the necessary BP templates in the /templates directory and customizing any of those files will override the core templates. You can also place custom JS and CSS in /templates/js/bp-custom.js and /templates/js/bp-custom.css respectively. The /inc directory includes files for placing custom actions, filters, template tags, and widgets.

bp-project-framework

The bp-custom.php file contains example code for easily customizing BuddyPress. If you’re new to BuddyPress development, you’ll want to check out that file to get an overview of some quick customization options.

The advantage of putting BP templates into this plugin over building them into the current theme is that you can easily activate and deactivate the plugin. It also allows you to maintain your templates if you decide to change themes, without having to move the template files.

When you have the BP Project Framework installed, BuddyPress will first look to the plugin for its template files and then will default to BP core if any are missing. Simply activate the plugin and start adding custom code, edit the template markup and add custom CSS and JS. The plugin has no settings, but the development team at WebDevStudios plans to add some new features and options in the future.

You can find BP Project Framework on GitHub. It’s a great resource for new BuddyPress developers who want a quick start for adding custom code and working with BP templates.

4 Comments


  1. Looks awesome! Would be great to have a similar plugin for customizing WooCommerce.

    Report


  2. So many of those supposedly confusing aspects asked by people vis a vis BP templates have been covered by us in fair depth on the BP codex though:
    http://codex.buddypress.org/themes/theme-compatibility-1-7/a-quick-look-at-1-7-theme-compatibility/
    http://codex.buddypress.org/themes/theme-compatibility-1-7/template-hierarchy/

    Seems a shame to need a plugin to to manage this aspect of BP templating and obviously if activating the plugin on another theme styles are not necessarily going to be compatible.

    Report


    1. hnla, if you are only editing a few files then I agree you can move a few templates over but when you do extensive BuddyPress customizations it is better to have everything maintained in a plugin. Yes, some styles won’t correlate with other designs. That’s not the point on the framework. Clients generally ask for the same things, “we want Facebook, we want a two column profile” etc. This is a way to have those things reusable. You can take the base framework and then code and design it into different types of base sites that you can reuse on later projects.

      Report


  3. Brilliant idea! Will be using this from now on :-)

    Report

Comments are closed.