Copied to clipboard

Flag this post as spam?

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


  • kristian schneider 187 posts 327 karma points
    Oct 20, 2009 @ 09:45
    kristian schneider
    0

    Cannot read properties on a member that is not logged in

    Im trying to retrive information on a member to display its properties.

    I do that by getting the member via email ie:

    _member =  Member.GetMemberFromEmail(email);
    var firstname = _member.getProperty("FirstName").Value.ToString()

    But that fails. If the member is logged in I can get the property without any problems.

    Is this by design?

    /Kristian

  • Aaron Powell 1708 posts 3044 karma points c-trib
    Oct 20, 2009 @ 23:25
  • Nik Wahlberg 639 posts 1237 karma points MVP
    Oct 21, 2009 @ 00:10
    Nik Wahlberg
    0

    If you have the opportunity to display memeber details is XSLT, here's a snippet for that:

    <?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">


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

      <xsl:param name="currentPage"/>
      <xsl:variable name="memberIdAlias" select="/macro/memberIdAlias"/>
      <xsl:variable name="memberId" select="$currentPage/data [@alias=$memberIdAlias]"/>

      <xsl:template match="/">
        <xsl:if test="$memberId!=''">
          <xsl:call-template name="memberDetails">
            <xsl:with-param name="member" select="umbraco.library:GetMember($memberId)"/>
          </xsl:call-template>
        </xsl:if>
      </xsl:template>

      <xsl:template name="memberDetails">
        <xsl:param name="member"/>
        Author Name: <b><xsl:value-of select="$member/@nodeName"/></b><br/>
        Email: <b><xsl:value-of select="$member/@email"/></b>
      </xsl:template>

    </xsl:stylesheet>

    Cheers,
    Nik

  • kristian schneider 187 posts 327 karma points
    Oct 21, 2009 @ 13:20
    kristian schneider
    0

    Hi Guys

    Thanks for the feedback. I went for slace's nice blogpost

  • 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