x First time here? Check out the FAQ

Come work for Umbraco - The Umbraco HQ are hiring Project managers, .NET developers and DevOps people!

  • Avatar2038posts3794karma

    Get Current Member and Profile Image

    Fuji Kusaka started this topic March 8, 2012 @ 12:16

    Hi Guys,


    Can someone point out how do i get to display the currentMember Name or other detailed information stored in the db and member section?

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

    But How about Razor??

    //fuji


  • merves posted this reply December 26, 2012 @ 11:40

      

    I have tried this

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

    <xsl:value-of select="umbraco.library:GetDictionaryItem('FirstName')" />
                  </label>
            <input type="text" id="firstName" name="firstName" value="{$member/@firstName}" />
                </div>

    But nothing returned. but when i called @loginName it returned properly. is anybody know that how i can get the member information?


  • Jan Skovgaard posted this reply December 26, 2012 @ 11:55

    Hi Merves

    If you're using an Umbraco version that is higher than 4.5.x then it's probably something like $member/firstName you should write (An element rather than an attribute). However to be sure what XML you have you can write the following

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

    Now you can see what the XML returned looks like and figure out what element to fetch in your value-of.

    @Fuji: Have a look at this post and - seems to me it has some interesting points http://our.umbraco.org/forum/developers/razor/19040-Working-with-members-and-Razor

    You should also be able to make use of all the known extensions in Razor, which you can find documentation for here: http://our.umbraco.org/documentation/Reference/Api/UmbracoLibrary/ - However there currently is no documentation examples using Razor. But I think that reading through the mentioned post above should get you going.

    Hope this helps.

    /Jan


Please login or Sign up To post replies