Problem with overlay in custom webform extension (D7) I'm doing my first drupal module (webform extension) and I have a problem with the overlay when editing a webform.

I added the "Factors" tab in my hook_menu():



$items['node/%webform_menu/webform-factors'] = array(
    'title' =&gt; 'Factors',
    'page callback' =&gt; 'drupal_get_form',
    'page arguments' =&gt; array('forms_grade_factors_create_factor'),
    'access callback' =&gt; 'user_access',
    'access arguments' =&gt; array('access administration pages'),
    'weight' =&gt; 5,
    'type' =&gt; MENU_LOCAL_TASK,
  );


But when I click on this Factor tab, the overlay disappears:



I don't know if it's important, but when I click on the other webform tabs, their urls are something like this:

drupal.dev/node/12#overlay=node/12/grant

And my module:

drupal.dev/node/12/webform-factors#overlay-context=node/12

How can I keep the overlay layer?
Thanks a lot!

EDIT:

I also implemented hook_admin_paths:

function webform_factors_admin_paths() {
  return array(
    'node/*/webform-factors' =&gt; TRUE,
    'node/*/webform-factors/*' =&gt; TRUE,
  );
}
The overlay automatically applies to paths that Drupal recognizes as being 'administrative'. That's always the case for paths that start with "admin", for example. 

For custom node tabs, however, you'll need to implement hook_admin_paths() to register your custom path pattern:

&lt;?php
function hook_admin_paths() {
  $paths = array(
    'node/*/webform-factors' =&gt; TRUE,
  );
  return $paths;
}
?&gt;