Adding Classes to first and last child of menu list - Joomla! Forum - community, help and support


i'm wanting add classes first , last child of 'mainmenu' mod list. first child class of 'first' , last child class of 'last'. code found controls list. i'm not sure php need this. know use css to first child , last child last child not supported ie7 or 6. why need figure out.

code: select all

if (($node->name() == 'li') && ($id = $node->attributes('id'))) {
   if ($node->attributes('class')) {
      $node->addattribute('class', $node->attributes('class').' item'.$id);
   } else {
      $node->addattribute('class', 'item'.$id);
   }
}


any can appreciated. thank in advance.






Comments

Popular posts from this blog

Joomla site hacked, cant see front and - Joomla! Forum - community, help and support

Christian Home School Programs - Joomla! Forum - community, help and support

Trouble with PF_OutFlag_I_USE_AUDIO and PF_CHECKOUT_LAYER_AUDIO