Working on my second Umbraco site an so far all have been smooth sailing. I got the build in membership provider working, however now I want to pass the ID of the currently logged in member to as flash application through a flashvar and absolutely none of the XSLT examples I found on the net + this forum worked. Returning the member with copy-of yields nothing.
One post suggested Umbraco still used the old API for these data and that you should write your own but I haven't been able to find any working examples of this.
I'm using Umbraco 4.5.2 out of the box installation.
Judging by the many posts here it seems to be a general issue :)
I assume you might get something like "No current member exists (best practice is to validate with 'isloggedon()' prior to this call)". If that's the case, you might try some of the solutions in this thread.
If those solutions don't help, it might be a bug. There's a bug in 4.7 RC where GetCurrentMember always returns that error, but it's slated to be fixed for the final. I'm not sure though if this bug was present in 4.5.2 or not.
Hopefully one of the fixes in the above thread works for you. Also, if you're familiar with .NET, the following code works for me to get the current member's ID without using GetCurrentMember. You could create an XSLT extension to access if needed from XSLT
int currentMemberId = umbraco.cms.businesslogic.member.Member.CurrentMemberId();
GetCurrentMember problem (Again)
Hi Everybody
Working on my second Umbraco site an so far all have been smooth sailing.
I got the build in membership provider working, however now I want to pass the ID of the currently logged in member to as flash application through a flashvar and absolutely none of the XSLT examples I found on the net + this forum worked. Returning the member with copy-of yields nothing.
One post suggested Umbraco still used the old API for these data and that you should write your own but I haven't been able to find any working examples of this.
I'm using Umbraco 4.5.2 out of the box installation.
Judging by the many posts here it seems to be a general issue :)
Thanks in advance
Odin
Hi Odin
Could you provide us with a sample of the code, which you're trying to fetch details from the current logged in member?
/Jan
Uh yes. I was a bit fast there :)
<xsl:variable name="member" select="umbraco.library:GetCurrentMember()" />
<xsl:value-of select="$member/@id"/>
I also tried
<xsl:value-of select="$member/node/@id"/>
which somebody wrote as an issue in later version.
Hi,
First of all, you should try outputting the results of GetCurrentMember to see what you are getting back. You can do this like so:
I assume you might get something like "No current member exists (best practice is to validate with 'isloggedon()' prior to this call)". If that's the case, you might try some of the solutions in this thread.
If those solutions don't help, it might be a bug. There's a bug in 4.7 RC where GetCurrentMember always returns that error, but it's slated to be fixed for the final. I'm not sure though if this bug was present in 4.5.2 or not.
Hopefully one of the fixes in the above thread works for you. Also, if you're familiar with .NET, the following code works for me to get the current member's ID without using GetCurrentMember. You could create an XSLT extension to access if needed from XSLT
Hope this helps,
Tom
Thanks. I've tried anything with xslt. It just doesn't render anything.
But I'll go with the backend solution. I need to do some webservices anyway :)
Thanks for your help :)
Odin
is working on a reply...