I have 2 conflicting menus I need to solve by adding an active class to a targeted menu only, they are a user menu and a profile and account settings menu which have overlapping links.
User Menu (in the header section of every page):
- [username] (links to Profile2 page)
- Account Settings (i.e. change password, etc.)
- Log out
- [username] (links to Profile2 page)
Profile and Account Settings menu (appears in the sidebar of the profile2 and account pages):
- View Profile (links to Profile2 page also)
- Edit Profile
- Account Settings (same link destination as "Account Settings" of User Menu)
- Order History
Since I'd like to convey to my users that whenever they are in any page linked by the Profile and Account Settings menu (eg. Edit Profile)I tried using Context to set an .active class for "User Menu>Profile", which worked.
However, now that "User Menu>Profile" is active when I'm in "Edit Profile", since "View Profile" shares the same link destination as "User Menu>Profile", both "View Profile" and "Edit profile" are have an .active class, which is very undesirable.
Hence, I would like to know, if there is a way to use Context or any hooks to set an .active class for the User Menu only when I'm in the "Edit Profile" page?