By Jboo on
Hi,
I'm trying to display a block on the homepage for logged in users. I've done this using mini panels but would like to display something like "Welcome (USER)". I can't seem to do this in the panel settings so can I create a block that gets the username of the currently logged in user using PHP to display on the homepage?
Any help is appreciated.
Comments
in your theme, you can do
in your theme, you can do this easily with the $user object.
e.g. add something like this to page.tpl.php:
Thanks for the reply. What I
Thanks for the reply. What I need to do is insert it using blocks and couldn't get this to work at first. However, I altered it slightly so it works now, but is this correct?
Thanks for your help.
My new EasySnoozing, Nursing and BusinessEgghead websites on D7!
Simple and Easy
Go to Structure->Block->Add block.
Give block title->block description>Block Body. copy this code and paste it and change the "Text format" to the format which supports Php code.
Done!
How I do it in Garland
How I do it in Garland Theme? instead of display the username i want to display Full name ie; Hi, Full Name ... i also created field in profiles.. called profile_fullname
Thank You so Much it's
Thank You so Much it's working
Use Views to do this!
See https://drupal.org/comment/8499219#comment-8499219
lunk_rat is Acquia Certified Grand Master