|
|
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
|
|
 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 helpsome 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.
|
|
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
|
|
 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.
|
|
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
|
|
Rank: Enthusiast
Joined: 1/28/2008 Posts: 34
|
Got it, i'm new to xslt :)
<xsl:value-of select="umbraco.library:GetCurrentMember()/@loginName"/>
Cheers
|
|
 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.
|
|
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
|
|
 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.
|
|
|
Guest |