2015-03-16 21:18:03 +00:00
|
|
|
---
|
|
|
|
title: Display a Custom Menu in a Drupal 7 Theme Template File
|
2020-03-08 14:32:13 +00:00
|
|
|
date: 2012-08-18
|
2018-12-31 12:13:05 +00:00
|
|
|
excerpt: The code needed to display a menu in a Drupal 7 template file.
|
2015-03-16 21:18:03 +00:00
|
|
|
tags:
|
2015-06-14 02:27:41 +00:00
|
|
|
- drupal
|
|
|
|
- drupal-7
|
|
|
|
- drupal-planet
|
|
|
|
- php
|
|
|
|
- aria
|
2015-03-16 21:18:03 +00:00
|
|
|
---
|
2020-03-08 17:52:59 +00:00
|
|
|
|
|
|
|
For reference, this is the code needed to display a menu in a Drupal 7 template
|
|
|
|
file, including the navigation ARIA role.
|
2015-06-18 07:58:56 +00:00
|
|
|
|
2017-03-16 08:09:52 +00:00
|
|
|
```language-php
|
2015-03-16 21:18:03 +00:00
|
|
|
$menu_name = 'menu-footer-menu';
|
|
|
|
$menu_id = 'footer-menu';
|
|
|
|
print theme('links', array(
|
2015-06-14 02:27:41 +00:00
|
|
|
'links' => menu_navigation_links($menu_name),
|
|
|
|
'attributes' => array(
|
|
|
|
'id' => $menu_id,
|
|
|
|
'role' => 'navigation',
|
|
|
|
'class'=> array('links', 'inline')
|
|
|
|
)
|
2015-03-16 21:18:03 +00:00
|
|
|
));
|
2017-03-16 08:09:52 +00:00
|
|
|
```
|