Maybe I'm being really dense, but this is giving me some trouble and the forum suggestions don't seem to be helping. I am using a MemberPicker property on a content node to choose registered users to promote. I am able to get their node ID, but can't get their first name, last name, etc. Is the membership object still needed in this case? The code is something like this:
var currentNode = umbraco.NodeFactory.Node.GetCurrent(); var currentPremium = currentNode.GetPropertyString("memberPicker");
//this returns the ID of the member picked on the content node
You can use the id with the function below to get the member object :
var currentNode = umbraco.NodeFactory.Node.GetCurrent();
var currentPremium = currentNode.GetPropertyString("memberPicker");
var member = umbraco.library.GetMember(Convert.ToInt32(currentPremium));
Accessing member properties from MemberPicker
Hi!
Maybe I'm being really dense, but this is giving me some trouble and the forum suggestions don't seem to be helping. I am using a MemberPicker property on a content node to choose registered users to promote. I am able to get their node ID, but can't get their first name, last name, etc. Is the membership object still needed in this case? The code is something like this:
I appreciate any advice in advance. Thanks!
Hi Phillip,
You can use the id with the function below to get the member object :
Hi Phillip,
I would recommend that you also take a look at the member picker documentation samples here
There is also included there a sample using uQuery which is my favoured method for getting member data.
Jeavon
Also worth mentioning that Umbraco v6.2 will bring us a new Members Api (woohoo!)
Thanks guys. The uQuery example worked. Much appreciated!
is working on a reply...