0

I've been looking around for a while and couldnt find a solution to my problem.

I need to add classes to submenu li items.

I've tryed to figure out editing Topmenu.php and Navigation.php (both inside core/Mage/Catalog and Core/Mage/ )

It looks kind of like this now

<ul>
<li class="first nav-1">link</li>
<li class="nav-2">link
  <ul>
    <li class="level1">sublink</li>
     <li class="level1">sublink</li>
    <li class="level1">sublink</li>
  </ul>
</li>
<li class="last nav-3">link</li>
</ul>

And thats what I need it to look like:

<ul>
<li class="first nav-1">link</li>
<li class="nav-2">link
  <ul>
    <li class="level1 nav1">sublink</li>
     <li class="level1 nav2">sublink</li>
    <li class="level1 nav3">sublink</li>
  </ul>
</li>
<li class="last nav-3">link</li>
</ul>
1

The category tree should be built here: \Mage_Page_Block_Html_Topmenu::_getHtml

But I recommend, to overthink your concept. Everything you want, is achievable with the n-thchild() selector.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.