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.
any can appreciated. thank in advance.
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
Post a Comment