Skip to:
Content

BuddyPress.org

Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#4726 closed defect (bug) (duplicate)

Bad titles on directories pages (issue in bp_get_name_from_root_slug)

Reported by: slaFFik Owned by:
Milestone: Priority: normal
Severity: major Version: 1.6.1
Component: Route Parser Keywords: needs-patch
Cc: slava.abakumov@…

Description

If you create a page called Community (for example) and then create Activity, Members etc pages and assign them to appropriate directory - BuddyPress will work fine (I mean users/groups links etc).
But bp_get_name_from_root_slug() will return false.

Reason - $bp->{$component}->root_slug will use part of url (like community/activity), while bp_current_component() will return just $bp->{$component}->slug. They are not equal and {{{bp_get_name_from_root_slug()}} -> false.

This problem prevents from translating title on directories pages.

$title = sprintf( __( '%s Directory', 'buddypress' ), bp_get_name_from_root_slug() );

This actually will be just Directory

Change History (7)

#1 @DJPaul
7 years ago

  • Component changed from Core to i18n
  • Keywords 1.8-early needs-patch added
  • Milestone changed from Awaiting Review to 1.8

#3 @boonebgorges
6 years ago

  • Component changed from i18n to Rewrite Rules
  • Keywords 1.8-early removed
  • Milestone changed from 1.8 to 1.9

#4 @slaFFik
6 years ago

  • Cc slava.abakumov@… added

#5 @boonebgorges
6 years ago

  • Milestone changed from 1.9 to 2.0

See also #4631.

#6 @boonebgorges
6 years ago

  • Milestone 2.0 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

This is a duplicate of #4630.

#7 @boonebgorges
6 years ago

In 8090:

Improve strings used for <title> and header of directory pages

Our legacy method for creating directory titles involved concatenating the
component name into '% Directory', which did not work well in languages where
a term like 'Groups Directory' would be translated into a single word. In
addition, there was inconistency between the <title> element on directory pages
and the header element used in the page body.

This changeset introduces a 'directory_title' parameter to BP_Core_Component,
so that directories can register a fully localizable string as the title/
header for directories.

To avoid filter name conflicts, the filter names associated with the headers
on group and blog directory pages were changed to _directory_header. See r7942,

See #4726, #4630

Fixes #4631

Note: See TracTickets for help on using tickets.