2015-03-16 21:18:03 +00:00
|
|
|
---
|
|
|
|
title: Display a Custom Menu in a Drupal 7 Theme Template File
|
2015-03-17 04:04:02 +00:00
|
|
|
nav: blog
|
2015-03-31 23:05:56 +00:00
|
|
|
use:
|
|
|
|
- posts
|
2015-03-16 21:18:03 +00:00
|
|
|
description: For reference, this is the code needed to display a menu in a Drupal 7 template file.
|
|
|
|
slug: display-custom-menu-drupal-7-theme-template-file
|
|
|
|
tags:
|
|
|
|
- Drupal
|
|
|
|
- Drupal 7
|
|
|
|
- Drupal Planet
|
|
|
|
- PHP
|
|
|
|
- ARIA
|
|
|
|
---
|
|
|
|
For reference, this is the code needed to display a menu in a Drupal 7 template file, including the navigation ARIA role.
|
|
|
|
|
|
|
|
~~~php
|
|
|
|
$menu_name = 'menu-footer-menu';
|
|
|
|
$menu_id = 'footer-menu';
|
|
|
|
print theme('links', array(
|
|
|
|
'links' => menu_navigation_links($menu_name),
|
|
|
|
'attributes' => array(
|
|
|
|
'id' => $menu_id,
|
|
|
|
'role' => 'navigation',
|
|
|
|
'class'=> array('links', 'inline')
|
|
|
|
)
|
|
|
|
));
|
|
|
|
~~~
|