summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandregriffin2013-03-23 21:02:42 (GMT)
committer andregriffin2013-03-23 21:02:42 (GMT)
commit1b903248c8196a32eaa9565915927b398a2a6f03 (patch)
tree84c3785eb31afad345ef32c580ef4b7ddf939736
parent48b0b01fbd35de70839c5113fc93a7d912fb70b5 (diff)
Issue #1896674 by generalredneck: Adds class 'active' to li on menu item
-rw-r--r--includes/menu.inc6
1 files changed, 5 insertions, 1 deletions
diff --git a/includes/menu.inc b/includes/menu.inc
index d04cb49..b23c8b0 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -90,7 +90,11 @@ function bootstrap_menu_link(array $variables) {
$element['#localized_options']['attributes']['data-target'] = '#';
}
}
-
+ // Issue #1896674 - On primary navigation menu, class 'active' is not set on active menu item.
+ // @see http://drupal.org/node/1896674
+ if (($element['#href'] == $_GET['q'] || ($element['#href'] == '<front>' && drupal_is_front_page())) && (empty($element['#localized_options']['language']) || $element['#localized_options']['language']->language == $language_url->language)) {
+ $element['#attributes']['class'][] = 'active';
+ }
$output = l($element['#title'], $element['#href'], $element['#localized_options']);
return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . "</li>\n";
}