You are here

function hook_menu_position_rule_alter in Menu Position 8

Same name and namespace in other branches
  1. 7.2 menu_position.api.php \hook_menu_position_rule_alter()
  2. 7 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.

File

./menu_position.api.php, line 25
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;
  }
}