Return to Snippet

Revision: 45763
at May 7, 2011 01:34 by nico65


Initial Code
// 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;   
   }

Initial URL
http://forum.joomla.org/viewtopic.php?p=2459568#p2459568

Initial Description
Copy /modules/mod_menu/tmpl/default.php to /templates/MYTEMPLATE/html/mod_menu/default.php

Initial Title
Joomla 1.6 add "first" and "last" CSS classes to mod_menu

Initial Tags
navigation, joomla

Initial Language
PHP