Creating a "My Account" Link that Goes to user/<uid>/edit
Hi, Can't believe I can't think how to do this... I want a "My Account" primary menu link that goes to: /user/<uid>/edit as opposed to just the normal: /user I tried using "user/%/edit" as the menu path but it didn't work. Thanks in advance for the help, Shai
I thought I had done this before but I guess not - I found this on the forums when I was looking - http://drupal.org/node/102162 -Steve
Hi,
Can't believe I can't think how to do this...
I want a "My Account" primary menu link that goes to: /user/<uid>/edit as opposed to just the normal: /user
I tried using "user/%/edit" as the menu path but it didn't work.
Thanks in advance for the help,
Shai -- [ Drupal support list | http://lists.drupal.org/ ]
Steve and Mike, Thanks so much for responding. I'm going to use that simple work-around that Steve pointed. Maybe not the most elegant, but certainly fast and maintainable. Shai On Sun, Jan 3, 2010 at 2:59 PM, <skessler@denverdataman.com> wrote:
I thought I had done this before but I guess not - I found this on the forums when I was looking - http://drupal.org/node/102162
-Steve
Hi,
Can't believe I can't think how to do this...
I want a "My Account" primary menu link that goes to: /user/<uid>/edit as opposed to just the normal: /user
I tried using "user/%/edit" as the menu path but it didn't work.
Thanks in advance for the help,
Shai -- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
On Jan 3, 2010, at 12:19 PM, Shai Gluskin wrote:
Steve and Mike,
Thanks so much for responding. I'm going to use that simple work-around that Steve pointed. Maybe not the most elegant, but certainly fast and maintainable.
Shai
On Sun, Jan 3, 2010 at 2:59 PM, <skessler@denverdataman.com> wrote:
I thought I had done this before but I guess not - I found this on the forums when I was looking - http://drupal.org/node/102162
Hey Shai, That forum page is a little out of date -- if you're using D6: In template.php: function mytheme_preprocess_page(&$vars) { //See http://api.drupal.org/api/function/template_preprocess_page/6 global $user; //other stuff... $vars['edit_profile_link'] = $user->uid ? l(t("Edit my profile"), "user/" . $user->uid . "/edit") : NULL; } In page.tpl.php: if($edit_profile_link) { print $edit_profile_link; } You could technically put all of that in page.tpl.php, but for separation of concerns do it this way. I've added this to the forum page as well. Hope this helps! -D
You could also use http://drupal.org/project/me and make just a normal menu link user/me/edit.
participants (4)
-
Domenic Santangelo -
KOBA | Hans Rossel -
Shai Gluskin -
skessler@denverdataman.com