Add menu block in administrator configuration page

Sat, 02/25/2012 - 12:02 -- meladawy

Although Drupal has a great API, But i see that its not well Documents, Anyway a few people have asked me about how they can create a block in administrator configuration page "admin/config", its easy but not well documented, I will do this by using HOOK_MENU, lets see:

/**
* Implementation of hook_menu
*/
function drupalst_blocks_menu() {
 
	$menu['admin/config/drupalst'] =  array(  // this is the block that contain another configuration links
		'title' => t('DRUPALST') , 
		'description' => t('Drupalst tools') , 
		'weight' => -8, 		
		'page callback' => 'system_admin_menu_block_page',  // we should implement this function in system.admin.inc file
		'access arguments' => array('access administration pages'), 
		'file' => 'system.admin.inc',	 // don't forget to add the file and path
		'file path' => drupal_get_path('module', 'system'),
		'position' => 'right', 
	); 
 
	$menu['admin/config/drupalst/blocks'] = array( // this is an example of configuration link
		'title' => t('Drupalst blocks') , 
		'description' => t('Add themed blocks to drupalst themes') , 
		'page callback' => '_drupalst_blocks_generator' , 		
		'type' => MENU_NORMAL_ITEM, 
		'access arguments' => array('administer site configuration') ,
	); 
 
	return $menu ; 	
}	



it looks Goood !!! mmmmmm

thants all :) , good luck

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.