Skip to content

Instantly share code, notes, and snippets.

@proweb
Created September 28, 2011 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save proweb/1249166 to your computer and use it in GitHub Desktop.
Save proweb/1249166 to your computer and use it in GitHub Desktop.
Last and first classes MOD_MENU Joomla default.php
// Copy /modules/mod_menu/tmpl/default.php to /templates/MYTEMPLATE/html/mod_menu/default.php
// Around line 34, find:
if ($item->deeper) {
$class .= 'deeper ';
}
// Replace this with:
$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