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.


cog.rusty’s picture

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):

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/me as a path in the menu entry.

umarbukhari’s picture

Is not there any method that I post a path on page path menu.

cog.rusty’s picture

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.

umarbukhari’s picture

yes this is the thing that i want. But it is not working I typed ther "user/me" but it not going to submit.

cog.rusty’s picture

Did you install the "me" module first?

umarbukhari’s picture

Thanks for helping me.

It has done.

manojprabhakar13’s picture

Can you let us know how have you done this ?


MattMoody’s picture

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?

Christopher James Francis Rodgers’s picture

I notice that you posted your issue some time back.

Please be aware that you posted your topic
in the 'Deprecated' (no longer used) section of the forums.

That is likely why you never got any replies.

Please note that this "topic" had been "Deprecated"
and will not be seen by typical forum users.

The "Deprecated section of the Forums"
is not actively used and is intended as a library archive
collection of old posts.

The only notice it will get is via notifications
to this topic's 'followers'.

Please "Post new Forum topic" in one of the active forums.

In your case I recommend that you post in the forum
-- Post installation http://drupal.org/forum/22

All the best; intended.
-Chris (great-grandpa.com)
"The number one stated objective for Drupal is improving usability." ~Dries Buytaert *