0

I'd like my other 3 menu items to sit under Manage Instagram in my Admin/Config menu but they are all being created as individual top level menu items.

  function instagram_menu() {

  $items = array();

  // Top Level Menu Item
  $items['admin/config/instagram'] = array(
    'title' => 'Manage Instagram',
    'type' => MENU_NORMAL_ITEM,
  );

  // Secondary Level Menu Item
  $items['admin/config/instagram/pull-images'] = array(
    'title' => 'Pull Instagram Images',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('instagram_form'),
    'access arguments' => array('administer site configuration'),
    'type' => MENU_NORMAL_ITEM,
  );

  // Secondary Level Menu Item
  $items['admin/config/instagram/client_id'] = array(
    'title' => 'Set Instagram Client ID',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('instagram_client_id_form'),
    'access arguments' => array('administer site configuration'),
    'type' => MENU_NORMAL_ITEM,
  );

  // Secondary Level Menu Item
  $items['admin/config/instagram/delete'] = array(
    'title' => 'Delete Instagram Data',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('instagram_delete_form'),
    'access arguments' => array('administer site configuration'),
    'type' => MENU_NORMAL_ITEM,
  );

  return $items;
}
0

According to Drupal menu item types you need to designate which item is the parent and designate the children as such. So in your case, I believe setting your 3 links as MENU_LOCAL_ACTION should resolve the issue. You might have to designate the top level menu item as MENU_DEFAULT_LOCAL_TASK to make it work depending on your settings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.