I'm using the GetGroupsByMemberId method to output the names of the groups to which a particular member belongs. However, I'm not sure what this returns in terms of specific XML structure, so I'm not sure how to parse the output into a list of group names.
I have this:
<xsl:variable name="memberId" select="number(umbraco.library:GetCurrentMember()/@id)"/> <p>The current member id is: <xsl:value-of select="$memberId"/></p> <p>The groups this member belongs to are:</p> <xsl:variable name="memberGroups" select="ucomponents.members:GetGroupsByMemberId($memberId)"/>
I've tried outputting the value of $memberGroups inside a textarea, but it doesn't output anything.
Does anyone know how to output a list of group names from this?
Put it this way... members need to be assigned to member groups ;) Yes - utterly shameful! Found this after I'd pulled apart uComponents and written my own version of the extension, for it not to work either. I can't even blame lack of sleep at the moment as the kids are away. Doh!
Get member group names from member id
Hi,
I'm using the GetGroupsByMemberId method to output the names of the groups to which a particular member belongs. However, I'm not sure what this returns in terms of specific XML structure, so I'm not sure how to parse the output into a list of group names.
I have this:
I've tried outputting the value of $memberGroups inside a textarea, but it doesn't output anything.
Does anyone know how to output a list of group names from this?
Thanks
Hi Dan,
Hmmm... starting to think that there's a bug in there somewhere? Haven't had chance to debug the code yet - will do soon!
As for the XML, it should look like this...
I'll let you know what I find with my debugging.
Cheers, Lee.
Nice one, thanks Lee!
No need to debug Lee, it works. Just me being very stupid! :)
Ah cool... dare I ask what happened? ;-)
Put it this way... members need to be assigned to member groups ;) Yes - utterly shameful! Found this after I'd pulled apart uComponents and written my own version of the extension, for it not to work either. I can't even blame lack of sleep at the moment as the kids are away. Doh!
Well, that's made me smile! Only in a "been there, done that" kinda way! :-)
is working on a reply...