How to show custom menu in Drupal admin panel
Author: Faaiq Ahmed
Author: Faaiq Ahmed
My PM give me task to show subscriber list in Drupals admin panel. And he said that admin can edit and delete any record from that list. I had already created the module subscriber with some code that is being used in site front. I added new menu item in that module to show subscriber list and wrote related functions to perform desired task. Task was working well but I had one problem. The menu items, I created, was not visible in admin panel like User management, Report etc. I wanted to show a heading and some menu items. The menu items I have created were visible at different location, in the top of admin panel where By Task and By module link exists. I opened core user module of Drupal and explored the code, how Drupal is showing menu item with heading in admin panel. I found following code in Drupals user module to show a box and menu item. $items['admin/user'] = array( 'title' => 'User management', 'description' => "Manage your site's users, groups and access to site features.", 'position' => 'left', 'page callback' => 'system_admin_menu_block_page', 'access arguments' => array('access administration pages'), 'file' => 'system.admin.inc', 'file path' => drupal_get_path('module', 'system'), ); This code shows a Heading and create a box in which Drupal can display child menu items. I copied and pasted this code in my subscriber module and made some changes that were required to my subscriber module. I refresh the page but there was nothing new. My menu items were not there. Above code only shows a heading and draw a box for child menu items. If you want some menu to display in this box then you should make path of you menu items like $items['admin/user/edit'] = array( Then edit menu item would be show in that box. But my problem was not that I had done these changes before for my subscriber module. I was unable to display my custom box in Drupal admin panel. Then I focused on child menu items where I used the type of menu to MENU_LOCAL_TASK I change one of my menu to MENU_NORMAL_ITEM then I refreshed the page and I found thet there is beautiful box with a heading and my custom box is displaying there and I changed type of all menu items to MENU_NORAML_ITEM which I want to display in that box. You can use MENU_CALLBACK for menu item that is not required to display in menu box.About the Author:
Faaiq Ahmed PHP Developer in
Arcgate
Investment and Career Opportunities in Africa Fat Burning Pills For Men - The Acai Berry Force Revolution Colloidal Silver For Aids And HIV Treatment Presbyterian Church Government Accuracy in specimen collection Best Natural Appetite Suppressant for Men – Which One? A review of UK's Procurement Industry in Recession Fat Loss Diet for Men and the Acai Berry Revolution Chemical Treatments for Stretch Marks A True Gift Is a Constant Reinforcement of Your Brand! How? How To Mend A Broken Heart? Revenda De Hospedagem - Um Grande Investimento San Diego Investment Property: How to Grow Your Network
www.yloan.com
guest:
register
|
login
|
search
IP(216.73.216.15) California / Anaheim
Processed in 0.020030 second(s), 8 queries
,
Gzip enabled
, discuz 5.5 through PHP 8.3.9 ,
debug code: 7 , 2491, 67,