Commit 3542c744 authored by Riccardo Padovani's avatar Riccardo Padovani

All links in the trail now are active, not only the bottom one

parent f1129685
......@@ -231,20 +231,31 @@ function valencia_links__system_main_menu($vars) {
* Follows http://design.ubuntu.com/web-style-guide/scaffolding#navigation
*/
function valencia_header_menu($vars) {
// Var with all HTML of the menu
$html = '<ul>';
// Var with all HTML of the menu
$html = '<ul>';
foreach ($vars['links'] as $key => $link) {
// To print every menu voice only one, see Drupal API
if (is_numeric($key)) {
$link_title = $link['#title'];
$link_href = $link['#href'];
$html .= '<li>' . l($link_title, $link_href, array('html' => 'true')) . '</li>';
}
}
foreach ($vars['links'] as $key => $link) {
// To print every menu voice only one, see Drupal API
if (is_numeric($key)) {
$link_title = $link['#title'];
$link_href = $link['#href'];
if ($link['#original_link']['in_active_trail']) {
$html .= '<li>' . l($link_title, $link_href, array(
'html' => 'true',
'attributes' => array(
'class' => array(
'active'
)))) . '</li>';
}
else {
$html .= '<li>' . l($link_title, $link_href, array('html' => 'true')) . '</li>';
}
}
}
$html .= '</ul>';
return $html;
$html .= '</ul>';
return $html;
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment