How is it possible in the WORLD? I swear I read the equivalent of 3 encyclopedias to no avail. I tried solutions in the regions, page.tpl.php and blocks. None of them give me what I need ... and I know that there are so many other people who need it too!
I came to the conclusion that I want to print the menu in my page.tpl.php file ... so no block solutions, please.
I want to be able to scroll through the links of the main menu (AND children) and rewrite the output so that the Drupal class is not marked by default. The closest I found is an example:
<?php if (is_array($primary_links)) : ?> <ul id="sliding-navigation"> <?php foreach ($primary_links as $link): ?> <li class="sliding-element"><?php $href = $link['href'] == "<front>" ? base_path() : base_path() . drupal_get_path_alias($link['href']); print "<a href='" . $href . "'>" . $link['title'] . "</a>"; ?></li> <?php endforeach; ?> </ul> <?php endif; ?>
As you can see, the links are reprinted with the custom class UL and LI ... what GREAT! However, children are not printed. How do I extend this code so that all children are part of the list? NOTE. I do not want the children to be displayed only on the parent page, they should be present all the time. Otherwise, the drop-down menu that I planned is useless.
I sincerely thank you for this to reduce my gigantic headache!
source share