Skip to content

Instantly share code, notes, and snippets.

@robdecker
Last active November 2, 2019 02:05
Show Gist options
  • Save robdecker/88676fbd2acdf05dfd3c to your computer and use it in GitHub Desktop.
Save robdecker/88676fbd2acdf05dfd3c to your computer and use it in GitHub Desktop.
/**
* Implements hook_menu().
*/
function mymodule_menu() {
$items = array();
$items['admin/config/mymodule'] = array(
'title' => 'My configuration section',
'description' => 'This is the parent item',
'position' => 'left',
'weight' => -100,
'page callback' => 'system_admin_menu_block_page',
'access arguments' => array('administer site configuration'),
'file' => 'system.admin.inc',
'file path' => drupal_get_path('module', 'system'),
);
// Need at least one child item before your section will appear.
$items['admin/config/mymodule/item'] = array(
'title' => 'First item',
'description' => 'This is the first child item in the section',
'page callback' => 'mymodule_item_callback',
'access arguments' => array('administer site configuration'),
);
return $items;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment