create tabs with hook_menu() for custom module since two hours im trying to create tabs in my custom modules backend.

I've tried severals suggestions but couldn't get any of them to work.

this is my current hook_menu() : 

    function social_links_menu() {
  $items['admin/config/system/social_links'] = array(
    'title' =&gt; 'social_links',
    'description' =&gt; 'Configure to fit clients needs',
    'page callback' =&gt; 'drupal_get_form',
    'page arguments' =&gt; array('social_links_settings'),
    'access arguments' =&gt; array('administer site configuration'),
    'file' =&gt; 'social_links.admin.inc',
  );

  return $items;
}


I simply want two tabs called: 'tab1' and 'tab2'.

Can someone give me an working example? This should be really simple, but right now it seems impossible
You need to define a 'root' path which is a normal menu item, and then add another item for each of the tabs. The first of these will inherit the properties of the root item, and the second will define its own callbacks.

Combined with the MENU_LOCAL_TASK and MENU_DEFAULT_LOCAL_TASK type constants, you should get the tabs you expect:

function social_links_menu() {
  $items['admin/config/system/social_links'] = array(
    'title' =&gt; 'social_links',
    'description' =&gt; 'Configure to fit clients needs',
    'page callback' =&gt; 'drupal_get_form',
    'page arguments' =&gt; array('social_links_settings'),
    'access arguments' =&gt; array('administer site configuration'),
    'file' =&gt; 'social_links.admin.inc',
  );

  $items['admin/config/system/social_links/tab1'] = array(
    'title' =&gt; 'Tab 1',
    'type' =&gt; MENU_DEFAULT_LOCAL_TASK,
    'weight' =&gt; -10
  );

  $items['admin/config/system/social_links/tab2'] = array(
    'title' =&gt; 'Tab 2',
    'type' =&gt; MENU_LOCAL_TASK,
    'page callback' =&gt; 'some_callback',
    'access arguments' =&gt; array('some permission')
  );

  return $items;
}