This project is read-only.

Best way to override DisplayText in GetItemMetadata in UserPartHandler?

Topics: Writing modules
Aug 13, 2013 at 5:58 PM
In Orchard.Users.Handlers.UserPartHandler:
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
            var part = context.ContentItem.As<UserPart>();

            if (part != null) {
                context.Metadata.Identity.Add("User.UserName", part.UserName);
                context.Metadata.DisplayText = part.UserName;
If I want to override the DisplayText, to another string provided by a ProfilePart attached to User, like ProfilePart.Alias, what should be the best way? Should I just create another GetItemMetadata method in my handler? But how do I make sure that my handler run after UserPart's?