By webpotato on
Hello,
I've hacked one line in my Drupal 6 Core User Module so that when a user logs is, the Navigation menu title does not switch to the user's username but rather the menu title "Navigation" is retained, followed by a line that reads "you are logged in as '{username]'.
While it's not too hard to edit this one line after each upgrade, I know it would be better to do it another way. Is there a module that would accomplish this? If not, can someone suggest a simple module that would do it?
Here's what I did as a hack:
Original:
case 1:
if ($menu = menu_tree()) {
$block['subject'] = $user->uid ? check_plain($user->name) : t('Navigation');
$block['content'] = $menu;
}
return $block;Hacked:
case 1:
if ($menu = menu_tree()) {
$block['subject'] = $user->uid ? t('Navigation<br><br>You are logged in as<br>"'.($user->name).'"') : t('Navigation');
$block['content'] = $menu;
}
return $block;
Comments
Use a tpl file
You should be able to do this at the theme level. Create a custom template block-user.tpl.php and edit it to add the text you want to the title string.