By Azerfin on
Well, I'm kind of a perfectionist, so I don't want my page to have unused and unneeded classes which just make the source look messier.
My main menu styles are based on elements, so no classes are needed. Now the code looks like:
<ul class="menu">
<li class="expanded first active-trail"><a href="/~azer/?q=node/7" title="Jaostot" class="active">Jaostot</a><ul class="menu">
<li class="leaf first"><a href="/~azer/?q=node/9" title="Jaos 1">Jaos 1</a></li>
<li class="leaf last"><a href="/~azer/?q=node/10" title="Jaos 2">Jaos 2</a></li>
</ul></li>
<li class="leaf"><a href="/~azer/?q=node/15" title="Jeejee">Jeejee</a></li>
<li class="leaf"><a href="/~azer/?q=node/14" title="Lisää">Lisää</a></li>
<li class="leaf"><a href="/~azer/?q=node/1" title="Leel">Testisivu</a></li>
<li class="leaf"><a href="/~azer/?q=node/11" title="Testisivu 2">Testisivu 2</a></li>
...
and I'd like it to look like:
<ul class="menu">
<li><a href="/~azer/?q=node/7" title="Jaostot" class="active">Jaostot</a><ul class="menu">
<li><a href="/~azer/?q=node/9" title="Jaos 1">Jaos 1</a></li>
<li><a href="/~azer/?q=node/10" title="Jaos 2">Jaos 2</a></li>
</ul></li>
<li><a href="/~azer/?q=node/15" title="Jeejee">Jeejee</a></li>
<li><a href="/~azer/?q=node/14" title="Lisää">Lisää</a></li>
<li><a href="/~azer/?q=node/1" title="Leel">Testisivu</a></li>
<li><a href="/~azer/?q=node/11" title="Testisivu 2">Testisivu 2</a></li>
...
I've tried to figure it out how to do it look like that. It can maybe be done by using theme functions overdrive, but none of those examples have really helped me. So if anyone could tell me a way to do it, and I'd love to have it demonstrated (like what code goes to template.php and so on). Also the same on other modules, not just the menu. But the menu is the most important <:
Thanks in advance!
Comments
has anyone found out how to
has anyone found out how to do this yet? i want to do the exact same thing.
Thanks in advance
See theme_menu_item
See theme_menu_item function:
So you need to put in your template.php file this:
Don`t forget to change name of the new function.
thank you so much. it works!
thank you so much. it works!