Give Menu Item Element ID - Joomla! Forum - community, help and support


is there way assign id tag each menu item, not class? either manual or automatic.

thanks!

hey. can edit (or better yet make override) of file:
modules/mod_menu/tmpl/default.php

somwhere around line 50:

code: select all

echo '<li'.$class.'>';


add 1 line before this:

code: select all

$class .= ' id="'.$item->id.'"';
echo '<li'.$class.'>';


in example, menu have class="item-xxx" id="xxx"

$item->id holds id can use other property of menu item id like:
$item->alias, $item->access, $item->menutype..........

if asked :pop





Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support