|
|
 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
|
|
 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 " "> ]>
<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
|
|
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
|
|
 Rank: Fanatic
Joined: 7/19/2006 Posts: 443 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)
|
|
 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.
|
|
|
Guest |