User Avatar Image and User name and Email in LIferay Theme

It's possible to add logged in user image to Liferay portal. We need to add this in themes.

Add the following line of code to portal_normal.vm file or any of the velocity file(.vm) where ever the user image needs to diplay.

<img src="/image/user_male_portrait?img_id=$user.portraitId&amp;" alt="User Name" width="25">

You can change the width of the image as per your requirement.

You can get the user name and user email address with the following code.

$theme_display.getUser().getFullName() - This will give us Logged in user full name;

$theme_display.getUser().getDisplayEmailAddress() - This will give us Logged in user email address.

Comments

Popular posts from this blog

Gradient Border Colors with CSS

10 Useful Libraries and Resources for Responsive Web Design

The Simplest Way To Center Elements Vertically And Horizontally