Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hey there,
Maybe this is possible already, but I don't quite get how to do it.. I'm trying to do redirect a user to his user edit page by using drupal_goto('user/'.$account->uid.'/edit') and would love if that sent him to 'user/me/edit' automatically.. I know I can just write 'me' in the drupal_goto, but I would really prefer not to hardcode stuff..
Any ideas would be greatly appreaciated!
Thanks,
Martin
Comments
Comment #1
nohup CreditAttribution: nohup commentedyou can use
me_variable_get('me_alias')
instead of$account->uid
this will let you configure the alias and keep your code functional as well.Comment #2
arski CreditAttribution: arski commentedHmm, well that works, but that makes the code me-module dependent, which is not necessarily something one would need.. is there no way I could just write in the user id and have the module take care of the rest for me? Like it does when I generate links using the l() function for example? I tried doing something like the following, but that didn't insert the 'me' bit instead of the uid, otherwise it would have been a nice option:
drupal_goto(url('user/'.$account->uid.'/edit'))
Thanks.
Comment #3
nohup CreditAttribution: nohup commentedThe 'me' module does not do that. You can try the solution in #3 at http://drupal.org/node/1003146, it should give you the 'username' instead of 'me' as the alias.