0

I was wondering if there is any good documentation out there on building second level tabs using the menu system. Here is some of the menu code in my module:

  $items['admin/settings/cvminterviews'] = array(
    'title' => 'Interview Scheduler',
    'description' => 'Overview',
    'file' => 'cvminterviews_admin_overview.inc.php',
    'page callback' => 'cvminterviews_overview_page',
    'access arguments' => array('administer cvminterviews'),
  );

  $items['admin/settings/cvminterviews/overview'] = array(
    'title' => 'Overview',
    'description' => 'Overview',
    'file' => 'cvminterviews_admin_overview.inc.php',
    'page callback' => 'cvminterviews_overview_page',
    'access arguments' => array('administer cvminterviews'),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10
  );

  $items['admin/settings/cvminterviews/interviewers'] = array(
    'title' => 'Interviewers',
    'description' => 'Interviewers',
    'file' => 'cvminterviews_admin_interviewers.inc.php',
    'page callback' => 'cvminterviews_interviewers_overview_page',
    'access arguments' => array('administer cvminterviews'),
    'type' => MENU_LOCAL_TASK,
  );

  $items['admin/settings/cvminterviews/interviewers/import'] = array(
    'title' => 'Import Interviewers',
    'description' => 'Import Interviewers',
    'file' => 'cvminterviews_admin_interviewers_import.inc.php',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('cvminterviews_interviewers_import_form'),
    'access arguments' => array('administer cvminterviews'),
    'type' => MENU_LOCAL_TASK,
  );

I would like to have

admin/settings/cvminterviews/interviewers/import

Be a secondary tab to:

admin/settings/cvminterviews/interviewers

but the above code doesn't seem to do anything with it. Any thoughts?

0

I needed to add the following to my code:

  $items['admin/settings/cvminterviews/interviewers/interviewers'] = array(
    'title' => 'Interviewers',
    'description' => 'Interviewers',
    'file' => 'cvminterviews_admin_interviewers.inc.php',
    'page callback' => 'cvminterviews_interviewers_overview_page',
    'access arguments' => array('administer cvminterviews'),
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );

The important part is to make this the exact same callbacks as the 'admin/settings/cvminterviews/interviewers' menu item, but with one more level, and assign the MENU_DEFAULT_LOCAL_TASK type.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.