List of protected page logged-in user has access to?
Hello,
I am trying to list out every protected page that the current logged-in user has access to from the root down. I used the "list pages by level" XSLT as a base, and modified it slightly to include a check for "page is protected" and "user has access", but I don't get any pages, and I'm not sure why (XSLT isn't my strong point... it looks ok to me!).
List of protected page logged-in user has access to?
Hello,
I am trying to list out every protected page that the current logged-in user has access to from the root down. I used the "list pages by level" XSLT as a base, and modified it slightly to include a check for "page is protected" and "user has access", but I don't get any pages, and I'm not sure why (XSLT isn't my strong point... it looks ok to me!).
This is what I've got so far:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
exclude-result-prefixes="msxml umbraco.library">
<xsl:output method="xml" omit-xml-declaration="yes" />
<xsl:template match="/">
<!-- The fun starts here -->
<ul>
<xsl:for-each select="/descendant::node [(umbraco.library:IsProtected(@id, @path) = true() and umbraco.library:HasAccess(@id, @path) = true())]">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</li>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>
Anyone got any ideas?
Thanks,
Greg
Hi Greg,
You need to start from the currentPage parameter to select nodes in Umbraco:
That ought to do it.
/Chriztian
Ah thank you, yes that fixed it!
Regards,
Greg.
is working on a reply...