How to remove User name from Navigation menu?
I tried to find $user->uid string in menu.module and menu.inc, but it doesn't help

Comments

Michael M’s picture

What you are requesting is to rename the navigation block so that it doesn't display the user's name?

Look for this line of code in the user.module file in the user_block function:

$block['subject'] = $user->uid ? check_plain($user->name) : t('Navigation');

and change it to:

$block['subject'] = t('Navigation');

----
http://eUploads.com

mayur.pimple’s picture

$block['subject'] = t('Welcome '.$user->name);

i want add " Welcome Username " so this is also useful for Websites.....

Mayur Pimple
9270367824
mayurpimple12@gmail.com

coltrane’s picture

The user name above the navigation menu block? Enter <none> for the block title on the block setting page.

Michael M’s picture

You learn something new everyday :)

I'd do it this way..

----
http://eUploads.com

niccottrell’s picture

The other option is to edit the user.module - after using this http://drupal.org/node/64248

Since the block module asks user.module to write the username in the left-hand menu... you need to change from line 574 if you want BOTH the Navigation menu AND a full name to be shown:

   if ($menu = theme('menu_tree')) {
		  if ($user->uid) { 
		  	$account = user_load(array(uid => $user->uid));
		  	if (!empty($account->profile_fullname)) {
   				 $profilename = $account->profile_fullname;
  		   	} else {
		   		$profilename = $user->name;
		   	}
           	$block['subject'] = $profilename;
		   } else {
		   	$block['subject'] = t('Navigation');
		   }
           $block['content'] = $menu;
uddhi108’s picture

Although this solution may work, it is not recommended to do. You should never do any changes in the core drupal files. When you update your drupal version, you'll lose all changes you've made.

If any changes should be done, it should be in a module or the theme layer (template files).