#2258 closed defect (bug) (fixed)
Wrong highlight CSS class in bp_get_loggedin_user_nav()
Reported by: | 21cdb | Owned by: | |
---|---|---|---|
Milestone: | 1.2.4 | Priority: | minor |
Severity: | Version: | ||
Component: | Core | Keywords: | needs-feedback |
Cc: | email@… |
Description
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
Original:
if ( $bp->active_components[$bp->current_component] == $nav_itemcss_id? ) {
Patch:
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)
Change History (7)
@
15 years ago
Custom Theme navigation browsing "Groups Directoy" - selected is also applied on useres "Groups" menu-item.
#3
@
15 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
@
15 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".
I think it's the expected behavior that all nav items show selected if you are in that area of the site.