Closed (fixed)
Project:
Drupal core
Version:
6.2
Component:
menu system
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
22 Apr 2008 at 04:49 UTC
Updated:
10 Nov 2009 at 20:56 UTC
I am porting a new version of my theme, Framework, to Drupal 6, and in my Drupal 5 version, I used the following override to add $zebra classes to li tags for ul.menu.
function phptemplate_menu_item($mid, $children = '', $leaf = true) {
static $count = 0;
$zebra = ($count % 2) ? 'odd' : 'even';
$count++;
return '<li class="' . ($leaf ? 'leaf' : ($children ? 'expanded' : 'collapsed')) .' ' . $zebra . '">'. menu_item_link($mid) . $children ."</li>\n";
However, I can't figure out how to get this working under Drupal 6. Here is the standard function for Drupal 6.
function phptemplate_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';
}
return '<li class="'. $class .'">'. $link . $menu ."</li>\n";
}
Any help would be much appreciated.
Comments
Comment #1
andregriffin commentedAnyone care to take a stab at it?
Comment #2
bensnyder commentedI'm looking for the SAME answer.... anyone out there have a 'quick n dirty'?
Comment #3
dmitrig01 commentedYou can do the same thing.
Comment #4
bensnyder commentedi. frikin. love. you.
dmitrig01 is god.
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #6
neeshpal commentedsubscribe.