Edit profile2 tab in view profile2 rendered with views I have a profile created using profile2 module. I want this profile to be rendered as a separate page and I have done so using views. The profile can be viewed in a url: www.example.com/application/authors/username.

I want to provide to the owner of the profile a tab on the page for editing it.

This should be simple using hook_menu, but it doesn't seem to work for me.


function MY_MODULE_menu() {
  $items['application/authors/%author/edit'] = array(
    'title' => 'Edit',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('profile2', 1),
    'access callback' => 'MY_MODULE_access_check',
    'access arguments' => array(1),
    'type' => MENU_LOCAL_TASK,
  );

  return $items;
}


Is the above code correct? Do I need to register the view as a parent tab?
Profile2 provides a submodule Profile2 pages which does exactly that: allows the ability to render the profile separately and includes an Edit tab.