Displaying avatars in transformations

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

Avatars can also be displayed in transformations. Here are some code examples that can be placed in your transformations.

 

The following code returns the image tag of the avatar contained in the AvatarGuid field of the currently transformed user, with a maximum sidesize of 50 px. and Alt tag equal to the user's Nickname or Username:

 

<%# GetUserAvatarImage(50, HTMLEncode(GetNotEmpty("UserNickname;UserName"))) %>

 

The following code returns the image tag of the avatar with ID UserAvatarID, of user with ID UserID, with a maximum sidesize of 50 px. and Alt tag equal to the user's Username:

 

<%# GetUserAvatarImage(Eval("UserAvatarID"),Eval("UserID"),50,Eval("UserName")) %>

 

The following code returns the image tag of the avatar with ID UserAvatarID, of user with ID UserID, with a maximum width of 40 px., maximum height of 45 px. and Alt tag equal to the user's Username:

 

<%# GetUserAvatarImage(Eval("UserAvatarID"),Eval("UserID"),0,40,45,Eval("UserName")) %>

 

Page url: http://devnet.kentico.com/docs/devguide/index.html?displaying_avatars_in_transformations.htm