I'm finding information about member profiles incredibly hard to collate into an understandable whole.
I have a site with a single member type, which has a couple of custom properties on it. Login and everything all works perfectly using the .NET controls. I can even view all the member properties easily from XSLT using the GetMember() function.
Now I want to create a page for members to edit their own profile, including the custom properties.
Everything I look at seems to have a different way of doing this! Surely it must be an incredibly common scenario?!
Can anyone point me to some definitive instructions on how to do this in Umbraco 4.5+? I'm willing to put something together myself but I actually don't even know where to start!
Lots of the suggestions seem to be that you have to add the properties into the web.config as well as in the admin system - surely that can't be required?
Okay, cool, I'll give that a bash now - looks like I would have expected to look - i.e. simple :o) Thanks!
I don't really care about using the ASP.NET membership model if this way is also legit as I will just be using the built-in Umbraco provider - what I don't want to do is to be using a method that is actually deprecated in 4.5 though - so if anyone can chip in with an "approved" method that would be good!
For the "non-deprecated/approved" version, I think you have to use member profiles to solve this. There is an article written by Aaron Powell that explains this very well:
Hi Mike, that is a great page; it looks like the ASP.NET membership provider is a real pain in the arse though. Umbraco makes it so easy to add member properties as and when you / the client might need them that having to have a compiled class for your member AND also having to add the aliases into the web.config seems like a real backwards step.
I can see why it would be the way to go if you had a complex custom provider scenario integrating into outside systems, but just using the Umbraco API seems to be by far the best solution for a simple Umbraco site with all the members managed entirely within the CMS.
Well, I've got it all working now! I'm going to mark Mike's response as the answer as that most closely matched my actual question; however, I'm going to go with the technique Bo posted.
Custom member properties in 4.5+
I'm finding information about member profiles incredibly hard to collate into an understandable whole.
I have a site with a single member type, which has a couple of custom properties on it. Login and everything all works perfectly using the .NET controls. I can even view all the member properties easily from XSLT using the GetMember() function.
Now I want to create a page for members to edit their own profile, including the custom properties.
Everything I look at seems to have a different way of doing this! Surely it must be an incredibly common scenario?!
Can anyone point me to some definitive instructions on how to do this in Umbraco 4.5+? I'm willing to put something together myself but I actually don't even know where to start!
Lots of the suggestions seem to be that you have to add the properties into the web.config as well as in the admin system - surely that can't be required?
Hi Rob,
I did this in a project I made a while ago, please let me dig up the code for you..
Alright, here we are - don't know if this is what you meant, but I'll give it ago:
I did it like this:
Member m = Member.GetCurrentMember(); m.getProperty("adresse").Value = txtAddress.Text; m.getProperty("by").Value = txtCity.Text; m.Email = txtEmail.Text; m.getProperty("telefonNummer").Value = txtPhone.Text; m.Save();
Okay, cool, I'll give that a bash now - looks like I would have expected to look - i.e. simple :o) Thanks!
I don't really care about using the ASP.NET membership model if this way is also legit as I will just be using the built-in Umbraco provider - what I don't want to do is to be using a method that is actually deprecated in 4.5 though - so if anyone can chip in with an "approved" method that would be good!
P.S. Do you have any example code for changing the name / email / password - i.e. the standard properties?
EDIT: Just noticed that you posted that. D'oh!
Hi Rob,
For the "non-deprecated/approved" version, I think you have to use member profiles to solve this. There is an article written by Aaron Powell that explains this very well:
www.aaron-powell.com/umbraco-members-profiles
Hope this helps.
Cheers,
Michael.
Hi Mike, that is a great page; it looks like the ASP.NET membership provider is a real pain in the arse though. Umbraco makes it so easy to add member properties as and when you / the client might need them that having to have a compiled class for your member AND also having to add the aliases into the web.config seems like a real backwards step.
I can see why it would be the way to go if you had a complex custom provider scenario integrating into outside systems, but just using the Umbraco API seems to be by far the best solution for a simple Umbraco site with all the members managed entirely within the CMS.
Hi Rob,
In agree with you. I actually haven't felt the need to use the profile stuff yet and prefer "the more simple way" also :-)
Cheers,
Michael.
Well, I've got it all working now! I'm going to mark Mike's response as the answer as that most closely matched my actual question; however, I'm going to go with the technique Bo posted.
is working on a reply...