Fetching member data Options
kenny
Posted: Wednesday, October 04, 2006 1:58:32 PM

Rank: Aficionado

Joined: 8/12/2006
Posts: 132
Location: Norway
Hello, I've added some custom attributes on member groups and want to list members with these extra attributes. Are there any helper functions for this purpose?

- kenneth

Kenneth Solberg - core dev - level 2 cert pro - my blog
HFloyd
Posted: Wednesday, October 04, 2006 7:50:38 PM

Rank: Fanatic

Joined: 7/19/2006
Posts: 205
Location: New York, NY, USA
Hi Kenneth,

I spent a bunch of time working out how to do this and came up with this XSLT, perhaps you can use it as a model for your own.

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
<xsl:stylesheet
      version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:msxml="urn:schemas-microsoft-com:xslt"
      xmlns:umbraco.library="urn:umbraco.library"
      exclude-result-prefixes="msxml umbraco.library">

<!-- GetMemberBio.xslt -->

<xsl:output method="xml" omit-xml-declaration="yes"/>

<!-- Parameters -->
      <xsl:param name="currentPage"/>
      <xsl:param name="intMemberID" select="/macro/intMemberID"/>


<!-- Member ID -->
<xsl:variable name="MemberID">
      <xsl:if test="$intMemberID = 0">
            <xsl:value-of select="umbraco.library:RequestQueryString('BSID')"/>
      </xsl:if>

      <xsl:if test="$intMemberID != 0">
            <xsl:value-of select="$intMemberID"/>
      </xsl:if>
</xsl:variable>

<xsl:template match="/">

<!-- GetInfo Block -->
      <xsl:if test="$MemberID != ''">
            <xsl:call-template name="FormatInfo">  
                     <xsl:with-param name="member" select="umbraco.library:GetMember($MemberID)"/>  
            </xsl:call-template>  
      </xsl:if>
</xsl:template>

<xsl:template name="FormatInfo">
      <xsl:param name="member"/>  
      <xsl:value-of select="$member/data [@alias = 'htmlBSBio']" disable-output-escaping="yes"/>  
</xsl:template>

</xsl:stylesheet>


If you don't understand anything, let me know.
Heather
Nespolo
Posted: Monday, April 07, 2008 10:52:10 PM
Rank: Newbie

Joined: 4/6/2008
Posts: 3
I need and xslt that shows the memberGroup of the logged user, do you know if it's possible to do that ? I've tried your code but it doesn't work
kalpa
Posted: Tuesday, April 08, 2008 12:18:28 PM

Rank: Fanatic

Joined: 7/19/2006
Posts: 433
Location: Göteborg, Sweden
Nespolo,
Have you tried Len Dierickx's XSLT extension library ? It contains (amongst other) a method called getMemberGroups() that is supposed to "Returns the list of groups the current member belongs to"?

I haven't tried it but I see no reason not to trust Len's sayings....

// ;) Kalle

" - Yeah I'd like to share your point of view, as long as it's my view too... (http://www.d-a-d.dk/lyrics/pointofview)
astuanax
Posted: Wednesday, April 09, 2008 10:42:14 AM

Rank: Devotee

Joined: 7/20/2006
Posts: 86
Hi,
Nice to see someone is using it, let me know if you have any problems.
Len.
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.