Last updated November 2, 2012. Created on April 22, 2010.
Edited by drupalshrek, aspilicious, admin7, Tor Arne Thune. Log in to edit this page.

Primary and Secondary links have been renamed to Main and Secondary menu. Themes which support these options will need to be updated to use the new variable names:

6.x: page.tpl.php

<div id="menu">
  <?php if (isset($secondary_links)) { ?><?php print theme('links', $secondary_links, array('class' => 'links', 'id' => 'subnavlist')); ?><?php } ?>
  <?php if (isset($primary_links)) { ?><?php print theme('links', $primary_links, array('class' => 'links', 'id' => 'navlist')) ?><?php } ?>

7.x: page.tpl.php

<?php if ($main_menu || $secondary_menu): ?>
  <div id="navigation"><div class="section">
      <?php print theme('links__system_main_menu', array('links' => $main_menu, 'attributes' => array('id' => 'main-menu', 'class' => array('links', 'inline', 'clearfix')), 'heading' => t('Main menu'))); ?>
      <?php print theme('links__system_secondary_menu', array('links' => $secondary_menu, 'attributes' => array('id' => 'secondary-menu', 'class' => array('links', 'inline', 'clearfix')), 'heading' => t('Secondary menu'))); ?>
  </div></div> <!-- /.section, /#navigation -->
<?php endif; ?>

You will also need to make the appropriate variable name changes if your theme's is defining features[]. Defining renamed or replaced features may cause all features to render as blank or empty arrays.

6.x: - features[]

features[] = primary_links
features[] = secondary_links

7.x: - features[]

features[] = main_menu
features[] = secondary_menu

Also, if your is defining features[] = mission please note that this feature has been removed and replaced with a variable named $mission which can be output in your page template.

Looking for support? Visit the forums, or join #drupal-support in IRC.


Scott J’s picture

This doesn't work. Perhaps it's changed recently?
The example in /modules/system/page.tpl.php is:

print theme('links__system_main_menu', array('links' => $main_menu, 'attributes' => array('id' => 'main-menu', 'class' => array('links', 'clearfix')), 'heading' => t('Main menu')));
chrisrockwell’s picture

update.php does not change the menu names in the database, you will have to manually do it for your menus to appear (along with using the above).

coreyc’s picture

You shouldn't have to do this if update.php ran correctly.