Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Andrew Waegel 126 posts 126 karma points
    Sep 16, 2010 @ 19:49
    Andrew Waegel
    0

    Getting current member properties with XSLT

    Hello,

    I'm having a problem getting curent member info via XSLT. I can fetch all the member's data via:

    <xsl:copy-of select="umbraco.library:GetCurrentMember()" />

    ...but I can't for the life of me (and I'm pretty comfortable with xsl) access the member details. It seems like this should get the login name attribute from the XML node returned by the library:

    <xsl:value-of select="umbraco.library:GetCurrentMember()/node[@loginname]" />

    ...and this should get the 'first_name' property:

    <xsl:value-of select="umbraco.library:GetCurrentMember()/node/first_name" />

    I'm missing something dumb and I can't tell what it is. Any ideas?

    Thanks,

    - Andrew

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Sep 16, 2010 @ 20:05
    Nik Wahlberg
    0

    What are you getting back in the copy-of? Can you paste in here?

    Thanks,
    Nik

  • Andrew Waegel 126 posts 126 karma points
    Sep 16, 2010 @ 20:08
    Andrew Waegel
    0

    I'm getting this:

    <node email="[email protected]" loginname="awaegel1" path="-1,1075" nodetypealias="EDR_Members" writername="Administrator" urlname="awaegel1" nodename="awaegel1" updatedate="2010-09-15T17:05:17" createdate="2010-09-15T17:05:14" sortorder="54" template="0" nodetype="1058" writerid="0" level="1" parentid="-1" version="662dee61-22a1-456f-b705-cd433ba2f5e5" id="1075">

    <first_name>a</first_name>

    <last_name>w</last_name>

    <auth_guid>b9b282da32ff41b2b367a046bd67811e</auth_guid>

    <isapproved>1</isapproved>

    <islocked>0</islocked>

    </node>

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Sep 16, 2010 @ 20:15
    Nik Wahlberg
    1

    So, instead of what you have above, trythis and you should be all set:

    <xsl:value-of select="umbraco.library:GetCurrentMember()/@email"/>

    <xsl:value-of select="umbraco.library:GetCurrentMember()/first_name"/>

    Thanks,
    Nik

  • Andrew Waegel 126 posts 126 karma points
    Sep 16, 2010 @ 20:50
    Andrew Waegel
    0

    Thanks, that worked great. It's been a while since I've had my head in xpath.

Please Sign in or register to post replies

Write your reply to:

Draft