Closed (fixed)
Project:
Context
Version:
6.x-2.0-beta4
Component:
Documentation
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
23 Apr 2009 at 14:57 UTC
Updated:
3 Jan 2014 at 00:07 UTC
Jump to comment: Most recent
Comments
Comment #1
yhahn commentedSorry, this helptext is very out of date. I've updated it with this commit http://drupal.org/cvs?commit=225056
When using the active menu reaction, the links you've selected will get an active class in the $primary_links or $secondary_links of your page.tpl.php. All you need to do after that is add the appropriate CSS in your theme.
Comment #3
ranavaibhavHello,
I'm sorry if I'm not suppose to re-open issue, but i did because I'm facing similar problem.
I have set one of my primary link menu to be activated when I'm in a context section (i have set context for all story pages)
When ever I'm viewing a story page i see the context is being activated in the context devel block however the menu item is not being activated.
I tried changing the active menu setting to the secondary menu item as well as my custom menu item, but no luck.
I tried different theme to make sure the problem is not with the theme I'm using (tapstry)
I also tried the committed version of "context.core.inc" file from the above link (comment #1)
Please advise what else could be an issue? Thanks.
Comment #4
tancIt doesn't appear to do anything for me either. Looking through the code, I'm struggling to find anywhere that adds an active class to a menu item.
Comment #5
tancOk, I worked out that there is a preprocess page function which should set the active link in the function context_preprocess_page(). I had my $primary_links variable turned off in the theme settings so it wasn't being populated. Once I'd switched it on it still wasn't altering it in context_menu_set_active(). The $links variable gets populated with the primary links array but only the top level of the menu system. I don't know if this is by design as I don't know a lot about the internal workings of Drupal's menu system.
Aside from all this, my main problem is that I'm using 3rd party modules to style my links. I have Nice Menus displaying a horizontal drop down menu and Menu Block displaying a sidebar block with the current Primary Menu Links' children. I would need to add active classes to both these blocks for this feature to work. Any ideas how this can be achieved?
Comment #6
rossymole commentedHaving the same issue, using the Context Devel block and setting other context functions I believe I have context configured correctly, yet no active menu state. Ideas?
Comment #7
snufkin commentedThe primary links will not set active if you use them through the primary links block. The workflow for rendering blocks doesn't allow context to intervene and change the menu structure as it does with the page preprocess.
Comment #8
q0rban commentedRe: #5
I used some jquery to get nice_menus to work with active and hovered items, if you're interested:
Nice thing about this is it also adds a hover class to the parent item when you are hovering over a child item. Hope that's helpful...
Comment #9
q0rban commentedTo get this working with nice_menus, you can also (in theme foo, e.g.) override the theme_nice_menu_build function like so:
Comment #10
monteco commentedI was having the same problem as tanc with my Nice Menus, and q0rban's nice_menu_build function worked for me. Thanks!
Comment #11
steven jones commentedI think that we just need some documentation about menu links and setting them to be active.
Comment #12
steven jones commentedAdded the help in http://drupal.org/cvs?commit=357604