Skip to content

Instantly share code, notes, and snippets.

@init90
Created October 12, 2016 15:47
Show Gist options
  • Select an option

  • Save init90/c1c3d8315f26f83b259840465950564f to your computer and use it in GitHub Desktop.

Select an option

Save init90/c1c3d8315f26f83b259840465950564f to your computer and use it in GitHub Desktop.
Drupal 7, create tabs in hook_menu
function social_links_menu() {
$items['admin/config/system/social_links'] = array(
'title' => 'social_links',
'description' => 'Configure to fit clients needs',
'page callback' => 'drupal_get_form',
'page arguments' => array('social_links_settings'),
'access arguments' => array('administer site configuration'),
'file' => 'social_links.admin.inc',
);
$items['admin/config/system/social_links/tab1'] = array(
'title' => 'Tab 1',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10
);
$items['admin/config/system/social_links/tab2'] = array(
'title' => 'Tab 2',
'type' => MENU_LOCAL_TASK,
'page callback' => 'some_callback',
'access arguments' => array('some permission')
);
return $items;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment