Created
October 27, 2010 23:49
-
-
Save illepic/650262 to your computer and use it in GitHub Desktop.
Theme menu output to include title class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// theme menu output to include title class | |
function theme_menu_item($link, $has_children, $menu = '', $in_active_trail = FALSE, $extra_class = NULL) { | |
$class = ($menu ? 'expanded' : ($has_children ? 'collapsed' : 'leaf')); | |
if (!empty($extra_class)) { | |
$class .= ' '. $extra_class; | |
} | |
if ($in_active_trail) { | |
$class .= ' active-trail'; | |
} | |
// add title for better cssing | |
$class .= ' leaf-title-'.str_replace(' ', '-', strtolower(strip_tags($link))); | |
return '<li class="'. $class .'">'. $link . $menu ."</li>\n"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment