Copied to clipboard

Flag this post as spam?

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


  • Phil Crowe 192 posts 256 karma points
    Dec 09, 2010 @ 12:34
    Phil Crowe
    0

    how can i get members by login name in xslt

    i know i can get them via the id with umbraco.library.GetMember(@id) but i need to access them by referencing the login name. any ideas?

  • Phil Crowe 192 posts 256 karma points
    Dec 09, 2010 @ 13:48
    Phil Crowe
    0

    I ended up changing some other code show that i had the id to work with. however cant seem to work out why this isnt working. after i get a member i can display them

          with this...<xsl:value-of select="$member"/>... and it works fine, showing the member and all their properties. 

          but when i just want to show on property...<xsl:value-of select="$mxml/firstName"/>.. nothing is returned even though there is definitely a value there?

  • Phil Crowe 192 posts 256 karma points
    Dec 09, 2010 @ 13:57
    Phil Crowe
    0

    OOPS <xsl:value-of select="$mxml/firstName"/> is actually <xsl:value-of select="$member/firstName"/> i changed the variable name so it made more sense on here.

  • Kim Andersen 1447 posts 2197 karma points MVP
    Dec 09, 2010 @ 21:51
    Kim Andersen
    0

    Hi Phil.

    Could you try to show us what the XML output of this is:

    <textarea>
    <xsl:copy-of select="$member"/>
    </textarea>

    And you are totally sure that your alias is spelled firstName right? Not using a capital F or a lowercase n or something like that.

    /Kim A

  • Phil Crowe 192 posts 256 karma points
    Dec 10, 2010 @ 09:19
    Phil Crowe
    0

    <xsl:value-of select="$member/*/firstName"/> fixed this.

  • Kim Andersen 1447 posts 2197 karma points MVP
    Dec 10, 2010 @ 19:37
    Kim Andersen
    0

    Ahh yeah of course. When you use the GetMember extension like that, the returned XML looks something like this:

    <node id="1060" nodeType="1070" email="some@mail.com" ...etc...>
    <firstName>MyFirstName</firstName>
    <lastName>MyLastName</lastName>
    ...
    ...
    </node>

    That's why the $member/firstName didn't return any value.

    Like you said you can use the star(*)-selector, or else you should use the $member/node/firstName to be a little more specific. But that's your choice :)

    /Kim A

  • Phil Crowe 192 posts 256 karma points
    Dec 13, 2010 @ 09:36
    Phil Crowe
    0

    ahh right. that makes sense. i was completely confused why this was happening. thanks kim.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies