Reputation: 11
I want to change name appear in Liferay portal after logged in. If i logged in Liferay, it has "Full name (Sign out)" on the top right of page.
Can I change the Full name to another name I config?
I have build a Liferay-login-portlet already.
Upvotes: 0
Views: 281
Reputation: 186
You have to implement a hook for the file /html/portlet/dockbar/view.jsp replacing in this code...
<liferay-util:buffer var="userName">
<img alt="<liferay-ui:message key="manage-my-account" />" src="<%= HtmlUtil.escape(user.getPortraitURL(themeDisplay)) %>" />
<span class="user-full-name">
<%= HtmlUtil.escape(user.getFullName()) %>
</span>
</liferay-util:buffer>
where it says user.getFullName() with that you want. For example, to use the user nick, use this
<liferay-util:buffer var="userName">
<img alt="<liferay-ui:message key="manage-my-account" />" src="<%= HtmlUtil.escape(user.getPortraitURL(themeDisplay)) %>" />
<span class="user-full-name">
<%= HtmlUtil.escape(user.getScreenName()) %>
</span>
</liferay-util:buffer>
Hope this helps. Regards.
Upvotes: 1