Any suggestions are welcome!
Thank you in advance!

Comments

Alek1983’s picture

How to display username in default USER MENU tittle for Drupal7

nhytros’s picture

subscribe
have you resolved? if yes, how?

Alek1983’s picture

block.tpl.php:
...

 global $user;
    if($block->subject == 'Navigation') 
    {
    $block->subject = check_plain($user->name);
    } 

...

JoshOrndorff’s picture

Worked for me. I changed 'Navigation' to 'User menu'.

-Josh

adityapavan’s picture

/*The following code can use to build new block for any theme and to place in default User Menu.
But i suggest to build new block so that you can place accordingly.*/

global $user; //decl var
 if ($user->uid) : //assing
 print l($user->name,'user/'.$user->uid); //name output
 print l("Logout","user/logout"); //logout output
     else : 
 print l("Login","user"); //if not login this condition
 
 endif;
Florian’s picture

Issue summary: View changes
Status: Active » Closed (fixed)