掲示板

User portrait image in journal template

thumbnail
7年前 に Syed Nasar によって更新されました。

User portrait image in journal template

Junior Member 投稿: 64 参加年月日: 15/09/03 最新の投稿
Hi,
I need to display user portrait image in web content. So In template I have written following code. But Its not working.

#set ($DigesterUtil = $portal.getClass().forName("com.liferay.portal.kernel.util.DigesterUtil"))
       #set ($profilePicUrl = $profilePicUrl + "_portrait?img_id=")
        #set ($profilePicUrl = $profilePicUrl + $usuario.getPortraitId())


        #set ($profilePicUrl = $tD.get("path-image") + "/user_")
        #if ($user.isFemale())
          #set ($profilePicUrl = $profilePicUrl + "female")
        #else
          #set ($profilePicUrl = $profilePicUrl + "male")
        #end

        #set ($profilePicUrl = $profilePicUrl + "_portrait?img_id=")
        #set ($profilePicUrl = $profilePicUrl + $user.getPortraitId())

        #set ($profilePicUrl = $profilePicUrl + "&img_id_token=")
        #set ($profilePicUrl = $profilePicUrl + $httpUtil.encodeURL($DigesterUtil.digest($user.getUuid())))

        <div class="img_user">          
            <img src="$profilePicUrl">
        </div>


as given in stack overflow.
Can anyone please solve it?
thumbnail
7年前 に David H Nebinger によって更新されました。

RE: User portrait image in journal template

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
That whole thing just seems wrong. The user model object has a getPortraitURL() method that just takes your themeDisplay object.
thumbnail
7年前 に Syed Nasar によって更新されました。

RE: User portrait image in journal template

Junior Member 投稿: 64 参加年月日: 15/09/03 最新の投稿
How can I get themeDisplay object in template?
7年前 に Gautam Sharma によって更新されました。

RE: User portrait image in journal template

Junior Member 投稿: 92 参加年月日: 12/04/30 最新の投稿
I think we don't have access to themeDisplay in webcontent templates

Please follow below link
Access Objects from Velocity