Is it possible to create a unique ID for each Top Menu item? Would I also be able to do this for the BODY tag?
Just curious why you need specific ID’s on these.
I need to style each menu item differently with CSS. Each menu item will have a different rollover color or background image. I would like to have a unique CSS class or ID for each.
I would like to know if there is a unique identifier that I can add to the top_menu.tpl page. Something like:
This is the default code:
Any ideas?
Try this:
```php
@TonyK
I did try that, but this code gives me the Visual name of the link. Example: If one menu item is labeled “Small Pets”, than the class would be “first-level-Small Pets”. This does not help.
Is there a way to call a Slug or ID number?
{$m.param_id}
or
{$top_menu.param_id}
Try those
Awesome! thanks TonyK.
the smarty tag {$m.param_id} worked perfectly. This is the generated code for one of the menu items:
Thanks again.
Happy skinning
@TonyK
Thanks again for the help on finding the proper string to add to a menu item. Now I’m looking for a Smarty string to add a unique ID or Class to the Body tag.
I tried
{$i.title}
but that gives me the actual Title with spaces.
Any ideas?
^^^
I also would love this, as well…I really need to easily target the same element differently on each page…I’m sure there’s a way to do this but I am unsure of what variable I need for this.