Drupal – Render a menu in View header or footer

You can render a menu in the header/footer of a view. Add the following code to either one of them.

<?php
  print theme('links', menu_navigation_links(<menu id>), array('class' => 'menu <custom-class>'));
?>


 

The <menu id> could be found by moving your mouse over the configure link @ Adminster -> Site building -> Blocks. The <menu id> of Primary links is primary-links as shown in the following picture.

 

Done =)

Reference: Add a custom menu to the header or footer of a views display (page or block)

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.