1

如何在 drupal 7/8 中的主页选项卡旁边添加模块链接到主菜单?这是我的代码

    <?php

function api_manager_menu() {

   $items = array();

   $items['api_manager'] = array(
    'title' => 'API Manager',
    'description' => 'Manage the  lifecycle of an API',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('api_manager_form'),
    'access arguments' => user_access('administer users'),
    'type' => MENU_NORMAL_ITEM
   );

   return $items;

}
4

1 回答 1

2

您只需要设置menu_name

$items['api_manager'] = array(
  'title' => 'API Manager',
  'description' => 'Manage the  lifecycle of an API',
  'page callback' => 'drupal_get_form',
  'page arguments' => array('api_manager_form'),
  'access arguments' => user_access('administer users'),
  'type' => MENU_NORMAL_ITEM,
  'menu_name' => 'primary-links'
);

有关更多信息,请参阅hook_menu()文档。

于 2012-08-29T18:58:47.693 回答