Im trying out implementing a members area for the first time (awesome by the way!) and was wondering if anyone could help me out with this.
<xsl:for-eachselect="$currentPage/node"> <xsl:iftest="umbraco.library:IsLoggedOn() and umbraco.library:HasAccess(@id, @path)"> <xsl:value-ofselect="@nodeName"/> </xsl:if> </xsl:for-each>
Basically I am trying to only list pages that you have access to and the above code seems to be a solution...but its in XSLT and I have my list pages already in Razor.
I have been trying to convert the above into razor with something like:
Memberships and Razor
Hi Guys,
Im trying out implementing a members area for the first time (awesome by the way!) and was wondering if anyone could help me out with this.
<xsl:for-each select="$currentPage/node">
<xsl:if test="umbraco.library:IsLoggedOn() and umbraco.library:HasAccess(@id, @path)">
<xsl:value-of select="@nodeName"/>
</xsl:if>
</xsl:for-each>
Basically I am trying to only list pages that you have access to and the above code seems to be a solution...but its in XSLT and I have my list pages already in Razor.
I have been trying to convert the above into razor with something like:
if(umbraco.library:IsLoggedOn() && umbraco.library;HasAccess(@id, @path)){
//do something
}
...but no luck. Am i on the right path?!
Much appreciated
Kenny
First of all in Razor you should use this syntax:
umbraco.library.IsLoggedOn()
And @id and @path won't work. Something like this might work:
Jeroen
Perfect Jeroen!
It was my syntax that was wrong (will need to keep this in mind!)
Thanks a lot for helping - i love this community - always sharing the love! :)
Kenny
Also check out the cool Razor Login project for more membership inspiration and give Jonas a vote while you're at it! :-)
is working on a reply...