You are here

function hook_menu_position_rule_alter in Menu Position 7

Same name and namespace in other branches
  1. 8 menu_position.api.php \hook_menu_position_rule_alter()
  2. 7.2 menu_position.api.php \hook_menu_position_rule_alter()

Allow a rule to be altered after it is evaluated but before action is taken.

Parameters

object $rule: The rule that was just evaulated.

array $context: A small context variable used by the menu_position module.

bool $rule_matches: Whether we have a matching rule or not.

bool $set_breadcrumb: Whether the breadcrumb still needs to be set or not.

2 invocations of hook_menu_position_rule_alter()
menu_position_evaluate_rules in ./menu_position.module
Evaluate all rules based on a given context.
menu_position_evaluate_rules in ./menu_position.module
Evaluate all rules based on a given context.

File

./menu_position.api.php, line 24
Hooks provided by the Menu Position module.

Code

function hook_menu_position_rule_alter(&$rule, array &$context, &$rule_matches, &$set_breadcrumb) {

  // Disable the rule if we're looking at a node with a certain id.
  if ($context['node']->nid == 119) {
    $rule_matches = FALSE;
  }
}