Skip to content

Instantly share code, notes, and snippets.

@proweb proweb/gist:1169347
Created Aug 24, 2011

Embed
What would you like to do?
Joomla 1.6 add "first" and "last" CSS classes to mod_menu
//Copy /modules/modmenu/tmpl/default.php to /templates/MYTEMPLATE/html/modmenu/default.php
// Replace
if ($item->deeper) {
$class .= 'deeper ';
}
// with this
$currentitemcount ++;
if ($item->shallower or $currentitemcount == count($list)) {
$class .= 'last ';
}
if ($lastdeeper or $currentitemcount == 1) {
$class .= 'first ';
}
if ($item->deeper) {
$class .= 'deeper ';
$lastdeeper = true;
} else {
$lastdeeper = false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.