#6769 closed enhancement (fixed)
BP Users front.php
Reported by: | hnla | Owned by: | imath |
---|---|---|---|
Milestone: | 2.6 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Templates | Keywords: | has-patch commit |
Cc: |
Description
In the same manner that single Groups can have their home page overloaded by adding a template named 'front' and with the recent improvements made to that capability vis a vis how the menus re-factor themselves to account for Activity no longer being the index/landing page by imath it's time to bring the user account screens into parity with Groups.
I think this is probably quite a sought after requirement as I certainly have had to build site pages that are far more general for users that act as a overview page where our current user screens are a little too specific to a single component.
Whereas this task doesn't propose actually building usable screens but just bolting in the mechanism, I've had a thought of a further step we can take to allow BP community to submit working templates that might be downloaded & dropped in to sites.
Encouraging the community to come up with custom user front templates would be a great way of getting people involved in the project, I envisage something along the lines of a small dedicated repo on bp github where we could curate submissions into a small gallery, freely available for people to use, the authors get to see their work publicly available, & it's not as time consuming as building a full blown plugin.
Curating shouldn't be too arduous, requiring simply running locally and checking that the template met some basic coding standards and didn't do anything silly. Keeping the templates updated would be the responsibility of each author, if not willing or able to the entry would be omitted from moving into a tag branch corresponding to new release version or something along those lines.
Attachments (4)
Change History (24)
This ticket was mentioned in Slack in #buddypress by djpaul. View the logs.
9 years ago
#3
@
9 years ago
Essentially want parity with the way groups work (along with imaths recent improvements groups received) groups and user account screens ought to work in pretty much same manner.
The other point to this is as I mention above to try and provide an easy means for people to create a more generic landing page, the specific component focussed view we currently work to doesn't really work in the sence that users probably want a more general overview.
This ticket was mentioned in Slack in #buddypress by imath. View the logs.
9 years ago
This ticket was mentioned in Slack in #buddypress by imath. View the logs.
9 years ago
This ticket was mentioned in Slack in #buddypress by dcavins. View the logs.
9 years ago
This ticket was mentioned in Slack in #buddypress by imath. View the logs.
9 years ago
#10
@
9 years ago
@imath Running this and it looks solid. Checking a few aspects but think we're good to commit generally.
#11
@
9 years ago
One thing I wonder as I play around is whether we should have the nav item 'Home' always visible but just displaying 'activity loop' if no front.php located and no 'activity' label link changing to adding activity label link and loop when there is a front.php in action.
#12
@
9 years ago
@hnla i'm not sure we should change 'Activity' to 'Home' if there's no custom front template. First if we are to do this, we'd also need to change 'Profile' to 'Home' if the activity component is not active.
For 2.6, i suggest we only introduce the custom front page for members and wait to see if users are expecting the nav renaming.
.02.patch is a refreshed version of the initial patch to take in account the latest improvements introduced in the BuddyPress navigation :)
If no objections, i'd like to commit this before next dev-chat.
#14
@
9 years ago
Will this change add a new template, or just add support loading a new template if one is in a user's theme?
#15
@
9 years ago
@DJPaul This change will not add a new template. The user's theme needs to include a members/single/front.php
to customize the home page for members.
About backcompat, there's a little change inside the members/single/home.php
. If the overridden template has not been updated to take this change in account, the members/single/plugins.php
template will be used instead of the expected front.php one.
I think it should be ok, but if we want to make sure even with an outdated members/single/home.php
the front.php template is loaded, we could use the bp_members_front_template_backcompat()
function i've added to 03.patch.
#16
@
9 years ago
This is great! 6769.03 works well for me, though I'm a bit on the fence about adding the extra level of backcompat. (It seems reasonable that if you want this new functionality and have the wherewithal to add specific front
templates, you should be able to update home.php
)
My only comment:
in bp_displayed_user_front_template_part()
, these filter parameters and descriptions seem odd or maybe just incomplete (could we set a name? Or not pass it, since this action should be unique to this use?):
/**
* Let plugins adding an action to bp_get_template_part get it from here
*
* @param string $slug Template part slug requested.
* @param string $name Template part name requested.
*/
do_action( 'get_template_part_' . $slug, $slug, false );
Great work!
#17
@
9 years ago
- Keywords commit added
Thanks @dcavins :)
In .04.patch i set a name and i remove the extra level of backcompat. I will commit it in a few hours.
Thanks everyone for your feedbacks.
So you want to add a
front.php
to the template stack for (all) member component screens?