By shigeruw on
I'd like to show "Logged in as USERNAME" (as in drupal.org) instead of "My account" on User menu of my drupal site.
How can I do this on my drupal site?
Thanks in advance.
I'd like to show "Logged in as USERNAME" (as in drupal.org) instead of "My account" on User menu of my drupal site.
How can I do this on my drupal site?
Thanks in advance.
Comments
Use
Use http://drupal.org/project/menu_token
Awesome
It works!
Many thanks.
How to use that module..?
How to use that module..?
Consider theming
I had this requirement from one of my clients too.
I resolved this by writing a theming hook. Here is how you do it.
You can find more information on theme_link() here.
Overide theme functions
Overriding theme functions in template.php like the one suggested by @Manish is the preffered and light weight approach to do it. Adding another module to change a string is a bit of an overkill because modules tend to increase the apache memory footprint.
Acer Aspire 5745
[i5 430M, 3GB, 320GB]
Ubuntu 12.04 (Precise Pangolin)
Drupal 6.15, 7.x
DigitalOcean, Go Daddy, Rackspace,
This code did not work for me
This code did not work for me any more suggestions..??
=-=
the code may have failed because its for different version of Drupal then that which you are using. You failed to mention which version is in use so difficult to provide more support.
Thanq for your response got
Thanq for your response got the solution.. im using drupal 7.38 and this code worked..
function YOURTHEMENAME_translated_menu_link_alter(&$item, $map) {
global $user;
if ($item['href'] == 'user') {
$item['title'] = t($user->name);
}
}