Display Member Information Options
Doogie Talons
Posted: Friday, June 20, 2008 4:09:24 PM
Rank: Enthusiast

Joined: 1/28/2008
Posts: 34
Hi is it possible to call member information into a page as a variable for the purposes of autofilling in the name of a form or tagging a comment in the blog package ?

Cheers

Rob
imayat12
Posted: Friday, June 20, 2008 5:22:12 PM

Rank: Addict

Joined: 7/19/2006
Posts: 593
Location: Preston, UK
Doogie,

have a look at member controls code in codeplex the profile control should help

some code from page_load

Code:


            string memberLogin = "";
            if (HttpContext.Current.Items["umbMemberLogin"] != null)
                memberLogin = HttpContext.Current.Items["umbMemberLogin"].ToString();
            else if (umbraco.helper.Request("member") != "")
                memberLogin = umbraco.helper.Request("member");

            // If no member parsed, then show current member...
            if (memberLogin == "" && umbraco.cms.businesslogic.member.Member.GetCurrentMember() != null)
                memberLogin = umbraco.cms.businesslogic.member.Member.GetCurrentMember().LoginName;

            if (memberLogin != "")




that gets you the current member and code further down gets the properties so you should be able to prefill your fields.

Regards

Ismail

Level 2 certified. If it aint broke dont fix.
Doogie Talons
Posted: Friday, June 20, 2008 5:32:03 PM
Rank: Enthusiast

Joined: 1/28/2008
Posts: 34
So you can't just call them into an xslt as a variable ? without programming a new ascx control.

Rob
imayat12
Posted: Friday, June 20, 2008 6:02:19 PM

Rank: Addict

Joined: 7/19/2006
Posts: 593
Location: Preston, UK
Doogie,

Ah ok sorry mate. Yes you can in xslt as well:

Code:

umbraco.library:GetCurrentMember()


then you can xpath into the properties as you do for content.

Regards

Ismail

Level 2 certified. If it aint broke dont fix.
Doogie Talons
Posted: Monday, June 23, 2008 1:51:06 PM
Rank: Enthusiast

Joined: 1/28/2008
Posts: 34
Thanks I have managed to display some details for example.

<xsl:value-of select="umbraco.library:GetCurrentMember()/data [@alias = 'aboutYou']" disable-output-escaping="yes"/>

How do I show core details like the loginname ?

Regards

Rob
Doogie Talons
Posted: Monday, June 23, 2008 2:42:30 PM
Rank: Enthusiast

Joined: 1/28/2008
Posts: 34
Got it, i'm new to xslt :)

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

Cheers
imayat12
Posted: Monday, June 23, 2008 3:35:02 PM

Rank: Addict

Joined: 7/19/2006
Posts: 593
Location: Preston, UK
Doogie,

A really good debug trick is to use xsl:copy-of it will dump the xml of the node in question and then you can see what you need to do.

Level 2 certified. If it aint broke dont fix.
Ig_p118
Posted: Tuesday, June 24, 2008 10:00:42 AM
Rank: Aficionado

Joined: 7/21/2006
Posts: 183
Location: Salerno - Italy
Is there a programmatic .Net method?

Red Consulting s.a.s - Umbraco from v1.0
imayat12
Posted: Tuesday, June 24, 2008 12:23:22 PM

Rank: Addict

Joined: 7/19/2006
Posts: 593
Location: Preston, UK
Doogie,

You could try something like

Code:


XmlNode n = ((IHasXmlNode)library.GetCurrentMember()).GetNode()
n.outerxml;


not tested the code but should be something like that.

Level 2 certified. If it aint broke dont fix.
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.