Skip to:
Content

BuddyPress.org

Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#5838 closed enhancement (fixed)

Remove "Profile" from Member page title

Reported by: sooskriszta Owned by: djpaul
Milestone: 2.2 Priority: normal
Severity: normal Version: 2.0
Component: I18N Keywords: has-patch
Cc: sooskriszta

Description

The title tag of member profile page says Name's profile.

The ";s profile" seems extraneous. Perhaps we can say, quite simply, Name.

Attachments (3)

5838#.patch (880 bytes) - added by sooskriszta 6 years ago.
I am sure I am missing something, but here goes
5838.ray.patch (1.9 KB) - added by r-a-y 6 years ago.
5838.ray.02.patch (2.4 KB) - added by r-a-y 6 years ago.

Download all attachments as: .zip

Change History (25)

#1 @DJPaul
6 years ago

  • Keywords reporter-feedback added

I am not sure which page you are referring to and cannot easily find one that does this on my local install. Can you share a sample link, please?

#2 @sooskriszta
6 years ago

  • Keywords reporter-feedback removed

http://buddypress.org/members/djpaul/

Paul Gibbs . Activity Streams . BuddyPress.org

http://buddypress.org/members/djpaul/profile/

Paul Gibbs . Extended Profiles . BuddyPress.org

I am talking about the title tag,

<title></title>

While for site developers and admins, or "extended profile" has a meaning, I feel that it does not add value and deteriorates the experience by adding noise.

The title of http://buddypress.org/members/djpaul/ should be simply

Paul Gibbs - BuddyPress.org

I don't think
http://buddypress.org/members/djpaul/profile/
http://buddypress.org/members/djpaul/activity/
http://buddypress.org/members/djpaul/forums/
should have titles different from the title for http://buddypress.org/members/djpaul/

But if they have to be, then we should consider changing them to:
http://buddypress.org/members/djpaul/profile/

Paul Gibbs - Profile - BuddyPress.org

http://buddypress.org/members/djpaul/activity/

Paul Gibbs - Activity - BuddyPress.org

http://buddypress.org/members/djpaul/forums/

Paul Gibbs - Forum Posts - BuddyPress.org

In fact, semantically, it's hard to explain why forum posts are now "activities", and how is it that other people's actions (e.g. calls) are posted on the Activities page for DJPaul. Perhaps we should consider renaming the "Activity" page. But I suppose that's for another ticket.

P.S. If you agree that this ticket is something we want, then I am happy to add a patch - seems pretty trivial.

#3 @boonebgorges
6 years ago

  • Keywords needs-patch added

+1 to these changes. sooskrizta, I'm not sure how trivial the changes will be (I think there's some funkiness in the way these page titles are built) but please do feel free to have a go at a patch.

#4 @DJPaul
6 years ago

  • Milestone changed from Awaiting Review to Future Release

@sooskriszta
6 years ago

I am sure I am missing something, but here goes

#5 @sooskriszta
6 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

I am pretty sure I am missing something crucial in the patch. Would appreciate feedback.

#6 @boonebgorges
6 years ago

  • Milestone changed from Future Release to 2.2

#7 @DJPaul
6 years ago

There is so much bad code in bp_modify_page_title it is making my brain hurt.

#8 @djpaul
6 years ago

In 9103:

Core: Page title: use correct i18n function when generating member page titles.

See #5838

#9 @djpaul
6 years ago

In 9104:

Core: Page title: code standards improvements.

See #5838

#10 @djpaul
6 years ago

In 9105:

Core: Page title: remove component name from members component item pages. Additional screens introduced by other plugins have been similarily changes.

This simplifies the <title> for the member profile screens; the longer the title, the less likely it will fit in the narrow space afforded by modern web browsers. I expect most people will only have one tab open for a one member (for example); it's an edge case to have multiple tabs open on different parts of the same user's profile for most/general use.

See #5838, props sooskriszta for the initial patch.

#11 @djpaul
6 years ago

  • Owner set to djpaul
  • Resolution set to fixed
  • Status changed from new to closed

In 9106:

Core: Page title: don't hardcode the word separator for some of our page titles.

Fixes #5838

#12 @r-a-y
6 years ago

  • Keywords needs-testing removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

The problem with r9105 is we get the same duplicate title tag across all pages for a user.

I'm not a fan of SEO, but we definitely should not have duplicate title tags.

Was the intent of r9105 to only have the displayed user's name for the <title> tag on the landing page for a user (eg. /members/USERNAME/)? If so, this makes more sense to me.

#13 @DJPaul
6 years ago

  • Keywords has-patch removed

No, the intent was:

I don't think 
http://buddypress.org/members/djpaul/profile/
http://buddypress.org/members/djpaul/activity/
http://buddypress.org/members/djpaul/forums/
should have titles different from the title for http://buddypress.org/members/djpaul/

we definitely should not have duplicate title tags.

Can you explain more?

#14 @r-a-y
6 years ago

  • Keywords has-patch added

Google doesn't recommend having duplicate title tags across different pages:
https://support.google.com/webmasters/answer/80407

ray.patch does a couple of things:

  • When on a user's landing page (eg. example.com/members/admin/), the page title will be admin | {SITE NAME}.
  • Uses the BP nav name for the page title instead of the admin title used on the "Settings > BuddyPress > Components" page. For example, when on example.com/members/admin/activity/, the page title will be admin | Activity | {SITE NAME}.
  • Added subnav title when on a member component sub-page. For example, when on example.com/members/admin/activity/mentions/, the page title will be admin | Activity | Mentions | {SITE NAME}.

This is similar to what sooskriszta proposed in the latter part of comment:2.

Let me know what you think.

Last edited 6 years ago by r-a-y (previous) (diff)

@r-a-y
6 years ago

#15 @DJPaul
6 years ago

  • $span = strpos( $bp->bp_nav[$component_id]['name'], '<span' ); What items have a span? Is this to cover components with item counts in their names?
  • I think the // translators comment needs to be directly above the line of code it refers to.
  • The construction in Append action name if we're on a member component sub-page looks a bit dubious from a translation POV (e.g. in case you need to re-order the position of the seperator)`

@r-a-y
6 years ago

#16 @r-a-y
6 years ago

Thanks for the feedback!

$span = strpos( $bp->bp_nav[$component_id]name?, '<span' ); What items have a span? Is this to cover components with item counts in their names?

Yup! You got it. The default BP components that add counts to the nav name are - Friends, Groups, Notifications, Messages. This isn't counting plugins. If the language file is using a different element, then the <span> search doesn't work. Could use regex or strip_tags and remove all numbers?

I think the translators comment needs to be directly above the line of code it refers to.

Thanks for that tidbit. This should be fixed in the updated patch.

The construction in Append action name if we're on a member component sub-page looks a bit dubious from a translation POV (e.g. in case you need to re-order the position of the seperator)

Right. The updated patch uses the sprintf() argument syntax used to construct the current page title, which I kinda hate, but I guess there's no other way.

Let me know what you think.

#17 @DJPaul
6 years ago

I have not tested this latest patch but I have spotted something I missed the first time I looked at it; I'm not 100% confident that ucwords is multi-byte safe. See https://stackoverflow.com/questions/4528119/best-function-for-title-capitlization for the best result I could find in Google. I think it'll be simpler just leaving the case as-is, unless you're familiar with any multibyte changes in order to test this.

#18 @DJPaul
6 years ago

To be clear, other than getting your opinion on the ucwords call, I think the patch looks good.

#19 @r-a-y
6 years ago

ucwords() was taken from the older title implementation. Just did a copypasta :)

But, you do have a legit point about ucwords() being utf-8-compatible.

In the current patch, I think if we change:

$component_name = $bp->{$component_id}->id;

to:

$component_name = ucwords( $bp->{$component_id}->id );

And remove the other ucwords() calls, we should be safe. It's very rare that the BP nav will not have a name attached to it.

#20 @DJPaul
6 years ago

Agree

#21 @r-a-y
6 years ago

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

In 9249:

Core: Make page title on member pages unique.

This commit partially reverts r9105, which made the <title> element the
same across all member pages, which goes against SEO conventions.

This commit does the following:

  • When on a member's landing page (eg. example.com/members/admin/), the page title will be admin | {SITE NAME}.
  • Uses the profile navigation name in the page title instead of the component's admin title. For example, when on example.com/members/admin/profile/, the page title will be 'admin | Profile | {SITE NAME}' instead of 'admin | Extended Profiles | {SITE NAME}'.
  • Adds the profile subnav name in the page title when on a member component sub-page. For example, when on example.com/members/admin/activity/mentions/, the page title will be admin | Activity | Mentions | {SITE NAME}.

Fixes #5838.

#22 @DJPaul
4 years ago

  • Component changed from Locale - Text Changes to I18N
Note: See TracTickets for help on using tickets.