[development] Creating admin pages.

Jennifer Hodgdon yahgrp at poplarware.com
Fri Sep 18 23:37:55 UTC 2009


I think you need to define your admin/store/pcampaigns as 
MENU_NORMAL_ITEM, then define another item as MENU_DEFAULT_LOCAL_TASK, 
for your other MENU_LOCAL_TASK to show up as a sub-item of this one.

i.e.

$items['admin/store/pcampaigns'] =
     MENU_NORMAL_ITEM (otherwise what you had before)
$items['admin/store/pcampaigns/manage'] = array(
    'title' => 'Manage',
    'type' => MENU_DEFAULT_LOCAL_TASK,
);
etc.

    --Jennifer

rajasekharan wrote:
> I am working on a module that requires a few admin interfaces. The admin 
> interface needs to list something from the database. Additionally there 
> should be a tab in the same page that has a form to inserts data into 
> the db. I am using hook_menu to do this but am having a problem with 
> getting the tab to appear. Below is my code:
> 
> function obc_menu()
> {
>     $items['admin/store/pcampaigns'] = array(
>                             'title' => 'Product Campaigns',
>                             'description' => 'Manage the campaigns that 
> the products in the store will support',
>                             'access arguments'=>array('manage campaigns'),
>                             'page callback'=>'obc_list',
>                             'type'=>MENU_DEFAULT_LOCAL_TASK,
>                             );
>     $items['admin/store/pcampaigns/add'] = array(
>                                                 'title'=> 'Add Campaign',
>                                                 'description'=>'Add a 
> campaign',
>                                                 'page 
> callback'=>'obc_add_pcampaign',
>                                                 'access arguments' => 
> array('manage campaigns'),
>                                                 'type'=>MENU_LOCAL_TASK
>                                                 );
> 
> return $items;
> }



-- 
Jennifer Hodgdon * Poplar ProductivityWare
www.poplarware.com
Drupal, WordPress, and custom Web programming



More information about the development mailing list