Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Intranet: Repeater webpart and custom data View modes: 
User avatar
Member
Member
ars - 8/5/2011 6:51:28 AM
   
Intranet: Repeater webpart and custom data
Hi everyone.

I' ve placed on Intranet home page Repeater web part with BlogPostLatest transformation
and declared Path property as '/%'. Because I want to Last BlogPost From whole intranet
including departments blogs. And it looks like:
User image

As you there is only Blog Post Name in the head of each row,
but I want to display also Department Name where this blog post was created.
Can you advise how to implement this?

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 8/5/2011 7:54:00 AM
   
RE:Intranet: Repeater webpart and custom data
Hi,

the blog document contains UserID of user who created the document in DocumentCreatedByUserID column - this can be displayed using Eval function.

Now you need to find out to which department is the user assigned to. You can implement it in the custom transformation method and pass userId as parameter to this method.

Using it you can find in which roles (departments) is user assigned and from roleID find the department name:


UserInfo ui = UserInfoProvider.GetUserInfo(53);

// you are able to find role IDs
DataTable dt = UserInfoProvider.GetUserRoles(ui);

RoleInfo ri = RoleInfoProvider.GetRoleInfo(41);
string depertmentName = ri.RoleName;



Best regards,
Ivana Tomanickova