I'm using content profile and I love it.
I have some users complaining about that when they click the "Edit" link tab in the user account page, it takes them somewhere where they can change their password but then they have to switch tabs to go to the content profile edit page.
I built a very simple module that registers a couple of menu items on the navigation menu that take the users directly to the "profile edit" and the "account options" pages.
Now I'd like to either remove all the edit tabs somehow and add maybe new tabs named "Edit profie" and "Account options" as I did with my navigation menu.

I red through the quickstart guide, the menu reference and a few issues (i.e. http://drupal.org/node/68792 and http://drupal.org/node/483324) but didn't work for me at all. I have devel and I flushed everything after each edit but the tabs never change!

This may be a very nice feature for content profile to specify a "default" type.
I could use any help to hack a little bit the menus to get this working as I'd like temporarily.

Comments

boogsbobo’s picture

Im trying to do the same thing and i can't figure out the approach, either. Would be a very nice feature, as the "edit" and "view" tabs in /user are very confusing.

Bilmar’s picture

hello josepvalls - could you please share with us your custom module you mention above.
Thanks you very much in advance!

josepvalls’s picture

It's not very elegant, but for the time being, this is what I did.
First of all. I removed the tabs, completely.
To do so, copied page.tpl.php to page-user.tpl.php and there I unset($tabs) and unset($tabs2).
Warning: This will also remove the tabs in the user login, password retrieval and account creation pages. I didn't really need those.

Then I created this module that registers the paths.

function menu_shortcuts_perm() {
  return array('menu shortcuts');
}
function menu_shortcuts_menu() {
  $items['user/settings'] = array(
    'title' => 'Settings',
    'page callback' => 'menu_shortcuts_settings',
    'access arguments' => array('menu shortcuts'),
    'type' => MENU_CALLBACK,
  );
  $items['user/profile'] = array(
    'title' => 'My Profile',
    'page callback' => 'menu_shortcuts_profile',
    'access arguments' => array('menu shortcuts'),
    'type' => MENU_CALLBACK,
  );
  return $items;
}
function menu_shortcuts_settings() {
  global $user;
  drupal_goto('user/'.$user->uid.'/edit');
}
function menu_shortcuts_profile() {
  // you probably don't need this. I have different roles with different content profiles.
  // my content profiles are names cliente and candidato
  global $user;
  if(in_array('cliente',$user->roles)){
    drupal_goto('user/'.$user->uid.'/edit/cliente');
  } elseif(in_array('candidato',$user->roles)){ 
    drupal_goto('user/'.$user->uid.'/edit/candidato');
  } else {
    drupal_goto('user/'.$user->uid.'/edit');
  }
}

And third step, in the navigation menu I added 3 items.
"My account" linked to the path "user"
"My profile" linked to the path "user/profile" defined in the module
"Account settings" linked to the path "user/settings" also defined in the module

You need to enable the module and grant the "menu shortcuts" permission. Or you can probably remove that too!

Hope this helps, I'm still waiting for a "better" solution. I love tabs, but never got them to work!