E.g. article has main menu as default, I want to add (and remove) second menu as available to article content type in my unit tests, how can I do it?
Tell me more
×
Drupal Answers is a question and answer site for
Drupal developers and administrators. It's 100% free, no registration required.
|
In your hook_menu and set 'access callback' to custom function. In this function return your $node->type == 'my_node_type' and/or user type that can access this node... |
|||
|
|
|
Anyway I win with my lazyness and read Menu module source, you can add menu to available menus list of selected node like:
|
|||||
|