Skip to:
Content

BuddyPress.org

Opened 2 years ago

Closed 2 years ago

Last modified 19 months ago

#7873 closed defect (bug) (fixed)

BP_DEFAULT_COMPONENT or Custom front template as the landing page ?

Reported by: imath Owned by: imath
Milestone: 4.0 Priority: normal
Severity: normal Version:
Component: Members Keywords: dev-feedback commit
Cc:

Description

In #7871 @sbrajesh gave his opinion about this alternative, saying as the custom front feature was introduced after this constant, the constant should be honoured in any case. I personaly don't think so, if a custom front page is added by a site owner, it's probably because he wants it to be the landing page.

What's your opinion about it ?

Attachments (1)

7873.patch (1.2 KB) - added by imath 2 years ago.

Download all attachments as: .zip

Change History (9)

#1 @sbrajesh
2 years ago

Thank you for opening this @imath

The front page functionality in BuddyPress is very limited. It is either all or none. At the moment, if we want to conditionally define landing page for user profiles(when front page is active), It is not feasible. The only way to accomplish this is by disabling the front page completely.

While supporting BuddyPress, I have seen the use cases where people do want to keep the front page and act is as the user dashboard but while visiting other's profile, they do not want the front page and default to something else.

I haven't looked into details but the above constant used to be the simplest way to provide the custom landing page.

Is there any other recommended way to do it? If not, should the BP_DEFAULT_COMPONENT be honoured even when front page is active? Or do you recommend filtering on 'bp_displayed_user_get_front_template' ?

Thank you.

#2 @hnla
2 years ago

In the first instance I failed to understand why a constant defining the default user screen should take precedence over having an active front page set as 'home' and as is generally the landing page/default screen, that just seems unintuitive, however the use case described where you might want your account with home page but visiting other users you land on ? 'profile' could have merit.

I'm still doubtful whether this is really an issue but brajesh has been working in detail with BP for long enough that it needs considering.

Can we not force that constant to act only for others users account if a front page is set as active, that would work for me in a ux approach, front page is primarily for the logged in user, grouping their dashboard like account elements, visiting another user and landing on their profile screen would be a good flow with their homepage being of less relevance to a visitor.

@imath
2 years ago

#3 @imath
2 years ago

7873.patch is bringing peace between the custom front page and the BP_DEFAULT_COMPONENT :) It's replying "yes" to @sbrajesh 's question :

If not, should the BP_DEFAULT_COMPONENT be honoured even when front page is active?

About having a different behavior between bp_is_my_profile() and viewing another user's profile. I would recommand to avoid bringing too much complexity about how the landing page is set.

I think it's best to add a new entry into the Template Hierarchy of the front page in bp_displayed_user_get_front_template, for instance :

if ( bp_is_my_profile() ) {
   $template_names[] = 'members/single/self-front.php'
}

#4 @sbrajesh
2 years ago

Thank you @imath and @hnla :)

Sincerely appreciate both of you getting it into the core.

Also, thank you for the advice @imath

#5 @DJPaul
2 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 4.0

I like it, good work everyone.

#6 @imath
2 years ago

  • Owner set to imath
  • Status changed from new to assigned

Thanks for your feedback @DJPaul I'll commit it asap.

#7 @imath
2 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 12179:

Members: give the last word to the BP_DEFAULT_COMPONENT constant

The default component defines the member's landing page. If this constant is defined and the corresponding component is active, it will set the component to load for this landing page, even if a custom front template is included into the site owner's theme.

Props sbrajesh, hnla, DJPaul

Fixes #7873

This ticket was mentioned in Slack in #buddypress by tw2113. View the logs.


19 months ago

Note: See TracTickets for help on using tickets.