Posted by umarbukhari on February 24, 2009 at 12:47pm
Hi..
I have a problem. I want to create a link in navigation bar with the name "My Profile" that take the user to its profile page. But I am unable to create it.
The problem is that I want to show this link on every user's page. I want to add it in navigation under a parent menu.
is there any solution.
When any user login, this link will take the user to his profile page/myaccount.
Please help me.
Comments
One way is to use some php in
One way is to use some php in a theme template file or in a block (if you have enabled the "php code" module in admin/build/modules):
<?php
global $user;
$userpath = 'user/' . $user->uid;
print "Welcome " . l($user->name, $userpath);
?>
If you want to put it in a regular menu, which doesn't allow php, you can use a different method:
First, install the http://drupal.org/project/me module to get links like "user/me" instead or "user/15" for the current user, and then use
user/meas a path in the menu entry.Is not there any method that
Is not there any method that I post a path on page path menu.
What do you mean "page path
What do you mean "page path menu"? The path of a post which you are editing? No, you don't want the post which you are editing to take the place of the user's profile.
The second method will let you put "user/me" in your menu and users will see their own profile when they click on it.
yes this is the thing that i
yes this is the thing that i want. But it is not working I typed ther "user/me" but it not going to submit.
Did you install the "me"
Did you install the "me" module first?
Thanks for helping me. It has
Thanks for helping me.
It has done.
Can you let us know how have
Can you let us know how have you done this ?
Thanks
Link not active
Link 'user/me' works, but it's never became active (tag's
<a>class does not switch to 'active'). Same thing with 'user/me/orders' link. Any ideas?