Skip to:

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#2258 closed defect (bug) (fixed)

Wrong highlight CSS class in bp_get_loggedin_user_nav()

Reported by: 21cdb's profile 21cdb Owned by:
Milestone: 1.2.4 Priority: minor
Severity: Version:
Component: Core Keywords: needs-feedback
Cc: email@…


If Theme Developers play around with bp_get_loggedin_user_nav() in there custom theme and make it visible all time, also if you are on the Groups Directory page, then it happens that the highlight class is applied on the "Groups (x)" menu item within bp_get_loggedin_user_nav() when you are on the Groups Directory Page. This is because both have "groups" within the url and item CSS id.

The issue can be prevent by adding !bp_is_directory check to bp_get_loggedin_user_nav()

File: bp-core-templatetags.php
Line: 429


if ( $bp->active_components[$bp->current_component] == $nav_itemcss_id? ) {


if ( !bp_is_directory() && $bp->active_components[$bp->current_component] == $nav_itemcss_id? ) {

Small issue, but annoying if someone wants to build its own navigation structure, would be great if this could be fixed.

Attachments (1)

Bildschirmfoto 2010-04-05 um 5.04. | 14.08.59.png (28.7 KB) - added by 21cdb 14 years ago.
Custom Theme navigation browsing "Groups Directoy" - selected is also applied on useres "Groups" menu-item.

Download all attachments as: .zip

Change History (7)

#1 @21cdb
14 years ago

  • Keywords has_patch added; highlight CSS class removed

#2 @johnjamesjacoby
14 years ago

  • Keywords needs-feedback added; has_patch bp-core-templatetags-php removed

I think it's the expected behavior that all nav items show selected if you are in that area of the site.

14 years ago

Custom Theme navigation browsing "Groups Directoy" - selected is also applied on useres "Groups" menu-item.

#3 @21cdb
14 years ago

I attached a screenshot to make it more visible why i think it shouldn't show "selected" on the bp_get_loggedin_user_nav() "Groups" menu item when browsing the "Groups Directory".

If a user is on his own "Groups" page he "selected" this certain menu item, so it should definitely show "selected". This is also valid if he selects "Groups Directory", but i don't see the why "Groups" should show as selected when a user is browsing "Groups Directory", because there is no real connection except both are dealing with groups. If all items would show "selected" class in this way, users "Friends" menu-item must also show "selected" when browsing the "Members Directory" - and that doesn't make sense in my opinion.

#4 @boonebgorges
14 years ago

According to the comments in the trunk, bp_get_loggedin_user_nav is not actually used anywhere in core, so it seems to be deprecated.

In any case, I am on the fence about whether this is indeed expected behavior. If for no other reason than that the only places where there is overlap in top-level components and user nav items is with Groups and Activity (not Friends/Members, which are different components). So it seems kind of inconsistent to do highlight the "parent" for those two nav items, but not for the rest since there's no corresponding "parent".

#5 @johnjamesjacoby
14 years ago

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

(In [2968]) Fixes #2258 props 21cdb

#6 @johnjamesjacoby
14 years ago

Boone is right. bp_get_loggedin_user_nav has been replaced in core by bp_adminbar_account_menu.

bp_get_loggedin_user_nav should probably be moved to the backpat plugin for 1.3.

@21cbd: you might be better off using 'bp_get_displayed_user_nav' instead.

Note: See TracTickets for help on using tickets.