Editing profile node as part of /user/%uid/edit page

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
sibaz's picture

I need to give a seamless implementation of a site, where users can edit a number of bits of information about themselves. The Default form in content_profile is to add tabs (primary or secondary) to the /user/%uid pages. The content_profile_registration module does it right, it allows you to tick a box, and so add the fields to the registration form, using hook_form_alter, to add fields to the 'user_register' form.

Is there a module which does the same for the user_profile_form? or hook_user($op=form, $category=account);

It seems there is a perfect example of combining a cck form into an existing form, in the content_profile_registration module, but no attempt to do the same in the content_profile module, when editing ones profile.

Comments

Same needs for me!

anon's picture

I have the same needs, this feature would be super awesome.

hook_menu_alter()

kaare's picture

This feature ++

However, I took another approach and re-ordered the menu items in secondary tabs, so that whenever a user clicked the edit link, he or she would end up at the content profile edit form. I also tried to minimize the user edit form to a minimum, basically only e-mail and password So:

user/%uid/edit -> content_profile node form
user/%uid/edit/account -> user_edit form

Aaaand, here is the hacky hack that does this, assuming the content profile is configured to be a secondary tab:

function example_menu_alter(&$items) {
  // Re-order the edit user profile secondary tasks
  if (module_exists('content_profile')) {
    $edit_account = $items['user/%user_category/edit'];
    $edit_account['title'] = 'Password and e-mail';
    $items['user/%user_category/edit'] = $items['user/%user_category/edit/profile'];
    $items['user/%user_category/edit']['title'] = 'Edit';
    unset($items['user/%user_category/edit']['tab_parent']);
    unset($items['user/%user_category/edit']['title callback']);
    unset($items['user/%user_category/edit']['title arguments']);
    unset($items['user/%user_category/edit/person']);
    $items['user/%user_category/edit/account'] = $edit_account;
    $items['user/%user_category/edit/person'] = array(
      'title' => 'Biographical data',
      'type' => MENU_DEFAULT_LOCAL_TASK,
      'weight' => -1,
      'load arguments' => array(
        0 => '%map',
        1 => '%index'
      ),
    );
  }
}

Profiles as nodes

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: