Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
Thanx! But but this topic about menu items.
I need to apply zebra to elements .item-list ul li in block "Popular content" of module Statistics.
How can I do this?
that should do it I haven't tested it but would be confident if you directly put in these 2 line above into the function you should see the odd even class added to you html (not recommending to directly change the function look at overriding it)
I think you misted a } on the end.
Do you also know how to get rid of the annoying empty line between two variabels?
See http://www.vindtocht.nl the blocks are using item-list, but I can't get rid of the empty line between the nodes..\
Comments
http://drupal.org/node/88096
http://drupal.org/node/88096
Thanx! But but this topic
Thanx! But but this topic about menu items.
I need to apply zebra to elements .item-list ul li in block "Popular content" of module Statistics.
How can I do this?
sorry for my english.
You've got several options
You've got several options here on how you do this
the function you need to modify (maybe) is the
http://api.drupal.org/?q=api/function/theme_item_list/HEAD
I'm not sure on the details but it would be better to override the function using a template.php file
you need to added/modify two lines of code mainly in defining the zebra variables ie towards the bottom of the theme_item_list change
$output .= '[li'. drupal_attributes($attributes) .']'. $data .'[/li]';
to
$zebra = ($count % 2) ? 'odd' : 'even';
$output .= '[li'. $zebra . drupal_attributes($attributes) .']'. $data .'[/li]';
that should do it I haven't tested it but would be confident if you directly put in these 2 line above into the function you should see the odd even class added to you html (not recommending to directly change the function look at overriding it)
later
M
Seems it's work after adding
Seems it's work after adding this function to template.php:
Is this right solution?
Hi, I think you misted a }
Hi,
I think you misted a } on the end.
Do you also know how to get rid of the annoying empty line between two variabels?
See http://www.vindtocht.nl the blocks are using item-list, but I can't get rid of the empty line between the nodes..\
greetings,
Martijn
Thanks
Thanks, this worked for my D6 build
This is an update to work
This is an update to work with "first" and "last" classes