By SamSound on
using the user module, on a user page i.e user/1. a local task is created, user/%user/view. and a local tab titled view is created. What im trying to do is change the title from view, to the profiles user name
ive tried
'title' => '[user]',
'title' => '$account_name',
but it doesnt get the users name.
How can I do this?
Thanks for any help
Comments
Are you in hook_user? If so,
Are you in hook_user? If so, $account->name will give you the user's name. If you are not using hook_user, then you can get the current user's name when you are in the user pages by using:
$account = user_load(arg(1));
$username = $account->name;
Not really sure what you are asking though. Hopefully one of those two examples can help you.
Contact me to contract me for D7 -> D10/11 migrations.
maybe you want this
maybe you want this
$GLOBALS["uid"];
$GLOBALS["nick"]; // (not sure about "nick" maybe is "user" chek on mysql hehe)
$GLOBALS_["key"];
is my fast answer i just tryed to help hehe
thanks for the help but im
thanks for the help but im not getting it.
the user module adds a local tasks to user profiles.
What im trying to do is change the title of the tab from view to the user account name.
So example if im user/1 the tab will say admin instead of view.
But I just dont know what to put there.
Thank you for any help
Try this
works! Thanks for the help
works! Thanks for the help
is it possible to add profile in the title aswell?
like admins profile. im not sure where i should be adding s profile.