Message Boards
Freemarker Variable not working in Layouts? (7.3)
Harry K, modified 3 Years ago.
Freemarker Variable not working in Layouts? (7.3)
New Member Posts: 3 Join Date: 3/16/21 Recent PostsHola,
In my 7.2 Liferay CE Portal I used ${user_last_name} in my Freemarker-Layouts (the Layouts you can assign to a page) - for example I got a welcome-Layout where the user is greeted by his full name.
Now with the newest version of Liferay CE Portal I am not able to do this?
Why? How can I achieve this now?
Mohammed Yasin, modified 3 Years ago.
RE: Freemarker Variable not working in Layouts? (7.3)
Liferay Master Posts: 591 Join Date: 8/8/14 Recent PostsHi ,
You can get the User Object or Theme Display Object from request and then fetch the user full name.
Ex:
${request.getAttribute("USER").getFullName()}
or
${request.getAttribute("LIFERAY_SHARED_THEME_DISPLAY").getUser().getFullName()}