What is BuddyPress template pack:-
A template pack is a set of template files(template parts) used by the plugins to provide theme compatibility. By theme compatibility, we mean adding support for the features offered by these plugins to any WordPress theme without extra effort. The template packs are provided to lower the entry barrier for the usage of these plugins.
BuddyPress template pack is a mechanism used by BuddyPress to offer a set of template packs which can be used with any theme. These template packs allow us to have one or more set of fallback templates which provide various features support to any WordPress theme.
A BuddyPress Template Pack consists of multiple template files called template parts(example:- members-loop.php for members list and so on), some assets(like css/js) and the code for registering the template pack*.
Which template packs are available for BuddyPress:-
BuddyPress comes with two template packs out of the box. They are:-
- BuddyPress Legacy
- BuddyPress Nouveau
How to use or enable/disable a BuddyPress template pack:-
To use a BuddyPress template pack, please login to your WordPress dashboard and follow these steps.
You will find the dropdown to select a template pack as shown below.
Screenshot showing the BuddyPress template pack dropdown in BuddyPress Setting.
By default, It consists of the BuddyPress Legacy/BuddyPress Nouveau template packs as shown below.
Note:- There may be other template packs if a 3rd party plugin decides to register their own template pack for BuddyPress.
What is the difference between BuddyPress Legacy and BuddyPress Nouveau template pack?
BuddyPress Legacy is the first template pack which came with BuddyPress. It was a successor of the bp-default theme(we may post about it some other day for the history buffs). BuddyPress Legacy was shipped with BuddyPress 1.7 to add theme compatibility for all WordPress themes.
This template pack is widely used and supported by plugins and themes. It is very easy to understand and adapt or override.
Our feelings about BuddyPress Nouveau:-
I asked our developers for their feedback about this template pack and the following paragraph represents our opinion.
In our opinion(BuddyDev team), Nouveau is a misplaced priority says Brajesh. It makes the developers life difficult( try reading through activity post form js code). It obscures actions and filters. Try finding hook in an IDE. It seems the current state of the nouveau template pack is not what it is advertised to do.
Extending it is not easy. You can save a lot of time and trouble with legacy template pack. Using Backbone js was another bad choice(our opinion). The goal of a software should be simple and easily understandable in order to be maintainable and extensible, but the dynamic hooks and that too with the nested calls to functions to generate them is a developer's nightmare. It seems this template pack is created to make sure people can not extend it much using plugins.
By the way, how many people think learning backbone js has any incentive in today's world(or had in 2018 when this template pack was released)? We are not against Backbone.js though, It is a great framework. They way it has been used in Nouveau is bad.
Other than being advertised as the hip and the new shiny thing, we still have to see the real advantage. Being JS driven can not be considered a feature for a template pack.
[/end of rant]
Which template pack should you use:-
It depends on 2 things:-
- Are you using a custom theme? Does it recommend a specific template pack. If yes, Use it.
- If your answer is no, Please feel free to try both and use the one you like most.
Should you use your own theme with the BuddyPress template pack or should you use a BuddyPress specific theme?
It depends a lot on your personal preference and the state of your site. If you are starting with a community, I recommend going with a BuddyPress specific theme.
If you have an existing site and you need limited community features, you may want to adapt the template packs to your current theme to keep it inline with the current experience of the user.
That's all for today. In the next post, we will see how to override BuddyPress templates in your theme.
Please do share your thoughts or questions about the template packs in the comment below. It will help us bring more clarity in the future posts.