A
A
advancesss2020-01-14 09:28:11
Drupal
advancesss, 2020-01-14 09:28:11

How to remove class for DRUPAL dropdown menu?

I wrote the following code in template.php in order to specify the required class for the menu.

function bartik_menu_tree($variables) {
  return '<ul class="mainmenu">' . $variables['tree'] . '</ul>';
}

But this class is also applied to child menu items. That is, like this
<ul class="mainmenu">
    <li><a href="#">Пункт</a></li>
    <li><a href="#">Пункт</a></li>
    <li><a href="#">Пункт</a>
        <ul class="mainmenu">
            <li><a href="#">Подпункт</a></li>
            <li><a href="#">Подпункт</a></li>
            <li><a href="#">Подпункт</a></li>
        </ul>
    </li>
</ul>

How to remove class="mainmenu" from child element?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question