1

I'm trying to add a dropdown menu to the administration toolbar for my custom module but it is not appearing. I have flushed the cache and disabled/renabled the module but with no avail. I am using Drupal 7 and my code is:

function reporter_workbench_menu() {
    $items = array();
    $items['admin/reporter'] = array(
        'title' => 'Reporter Workbench',
        'description' => 'Main menu item which should appear on the toolbar',
        'position' => 'left',
        'weight' => -100,
        'page callback' => 'system_admin_menu_block_page',
        'file' => 'system.admin.inc',
        'file path' => drupal_get_path('module', 'system'),
    );

    $items['admin/reporter/sub-menu-1'] = array(
        'title' => 'Sub menu item 1',
        'description' => 'Child of the menu appearing in toolbar.',
        'page callback' => 'reporter_workbench_section_edit',
        'type' => MENU_NORMAL_ITEM,
    );

    $items['admin/reporter/sub-menu-2'] = array(
        'title' => 'Sub menu item 2',
        'description' => 'Child of the menu appearing in toolbar.',
        'page callback' => 'reporter_workbench_section_edit',
        'type' => MENU_NORMAL_ITEM,
    );

    return $items;
}

How do I properly add a dropdown item to the administration tool bar such as hovering over the "Content" tab?

  • Your code looks OK , are you sure about module implementation? is reporter_workbench.info implemented correctly? – Alireza Tabatabaeian Aug 27 '15 at 19:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.