Displaying the user's name instead of their username

Topics: Customizing Orchard, General, Troubleshooting, Writing themes
Aug 23, 2012 at 10:04 AM

Hi Guys,

In User.cshtml, the CMS's default template uses WorkContext.CurrentUser.UserName to display the welcome message. Our client has requested that we display the users first name instead but I can't seem to figure out how to do it. I found this this thread but the method detailed no longer appears to work..

http://orchard.codeplex.com/discussions/255594

Can anyone help. I've examined WorkContext.CurrentUser.ContentItem extensively in the view window but can't find it anywhere!

Thanks

Coordinator
Aug 24, 2012 at 12:32 AM

Install the Profile module, then add some custom properties to ProfilePart like Firstname. Then override the shape which displays the username and use @WorkContent.CurrentUser.ContentItem.ProfilePart.Firstname

 

Aug 24, 2012 at 2:48 PM

Many thanks for your reply. For some reason I thought that there were already name fields but it appears not so I'll give the the Profile module a try.