Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > User Avatar in Messages web part View modes: 
User avatar
Member
Member
Naresh - 3/23/2011 2:47:01 PM
   
User Avatar in Messages web part
Hi!

I have created a custom web part to display the user messages using the CMS Query repeater. I am using a transformation, query name, and where condition properties to display the messages from DB.
I am able able to get all the data for a message from my transformation, but not able to display the Avatar of the Message Sender. I am using the transformation method GetUserAvatarImage() and passing the required parameters.

Can any one please help me in this issue.

Thank You,

Naresh

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 3/25/2011 7:05:19 AM
   
RE:User Avatar in Messages web part
Hi,

could you please try to use following transformation code? The code uses this method:
GetUserAvatarImage(object avatarID, object userID, int maxSideSize, int width, int height, object alt)
<%# GetUserAvatarImage(CMSContext.CurrentUser.UserAvatarID, CMSContext.CurrentUser.UserID, 100, 100, 100, "altDescription") %>

It will dispaly avatar image of current user.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
Naresh - 3/25/2011 11:09:49 AM
   
RE:User Avatar in Messages web part
Thank You Ivana for the reply,

In this case I don't want the current user avatar, I want the avatar of the person who send me the message.
But, I have solved the issue. I have created a custom query, now am able to get the avatar.

Thank you,

Naresh

User avatar
Member
Member
gatsby0121 - 11/25/2011 5:32:42 AM
   
RE:User Avatar in Messages web part
Can you post your code that you used to grab the image? I'm trying to do it in the code behind, but I haven't found a method yet to do it.

Thanks

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 11/29/2011 8:20:50 AM
   
RE:User Avatar in Messages web part
Hi,

the image is stored in the table CMS_Settings, UserPicture column.

You can use user API to get value of this column using GetValue method.

Best regards,
Ivana Tomanickova