Hey guys, I've been using Contrib.Profile [Stanley Goldman edition ;) -
] as a bit of guide [not implemented, just reviewing the code] to allow the logged in user the ability to edit their profile from the frontend. In my experiment case, I have attached/extended the User Record with a Profile Record [currently it just has two
fields for testing].
table => table
//ProfilePartRecord_id [Auto Key]
ContentDefinitionManager.AlterTypeDefinition("Profile", t => t
ContentDefinitionManager.AlterTypeDefinition("User", t => t
The question is, I'm a little perplexed as to how/what's the best way to access the two extended field's data for editing in relation to the Contrib.Profile 'Edit' action:
public ActionResult Edit()
if (_orchardServices.WorkContext.CurrentUser == null)
IUser user = _orchardServices.WorkContext.CurrentUser;
dynamic shape = _orchardServices.ContentManager.BuildEditor(user.ContentItem);
obviously the above gets the ORchard.Security IUser models username & email, but I need to acquire the related Firstname, Lastname from the Profile Record as well. Is this a matter of getting the CurrentUsers ID key, querying the DB for the related Profile
-- or is there a better methodology? Thanks in advance, Cheers Ron
PS> I looked into the Hungary.Demo AdminController which got me quite confused with orchard's way of doing things; I'm clearly inexperienced.