Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Francielle 65 posts 279 karma points
    Aug 09, 2017 @ 16:52
    Francielle
    0

    Getting name from user picker property

    Hi,

    I have a property in a doctype which uses Datatype User Picker. I am trying to get the name of the person selected on this property.

    I tried a suggestion from another topic: https://our.umbraco.org/forum/templates-partial-views-and-macros/77098-getting-username-from-user-id#comment-246470

    var member = Umbraco.TypedMember(CurrentPage.author); @member.Name

    But that did not work. On CurrentPage.author I get the user ID, but in method Umbraco.TypedMember(CurrentPage.author) I have a null result. I'm using Umbraco 7.6.4

  • Francielle 65 posts 279 karma points
    Aug 09, 2017 @ 17:12
    Francielle
    100

    This is how I fixed this:

    var author = umbraco.BusinessLogic.User.GetUser(CurrentPage.author);
    
    @author.Name
    
Please Sign in or register to post replies

Write your reply to:

Draft