Copied to clipboard

Flag this post as spam?

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


  • Adam Conde 12 posts 58 karma points
    Jun 30, 2009 @ 21:48
    Adam Conde
    0

    Access a custom member property in XSLT?

    How can i gain access to Member properties that I've created for a Member Type?

    In c# i use:

    member.getProperty("address").Value

    ...but how do i do it in XSLT?

  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Jun 30, 2009 @ 22:11
    Morten Bock
    101

    You can see the xml for your members by using the copy-of function, and the xpath your way to the data:

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

    From there the xml should be pretty much like a regular node. Something like:

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jun 30, 2009 @ 23:06
    Dirk De Grave
    102

    Adam,

     

    If you're going to list a number of properties, consider creating a variable first to hold the value of GetCurrentMember(), to avoid hitting the database too much... (Member data is retrieved for each GetMember(id) or GetCurrentMember() call!

    <xsl:variable name="currentMember" select="umbraco.library:GetCurrentMember()"/>

    and query for properties as Morten outlined before

    <xls:value-of select="$currentMember/data [@alias = 'PropertyAlias']" />

     

    Cheers,

    /Dirk

  • João Pereira 41 posts 64 karma points
    Oct 13, 2010 @ 00:54
    João Pereira
    0

    Forget it... sorry!

Please Sign in or register to post replies

Write your reply to:

Draft