The problem with this approach is that this also shows pages that the user doesn't have access rights to. These pages shouldn't be displayed when the user is logged in and isn't part of the member group that has the access rights.
I can't find the documentation for adapting the above code so that it checks if the user is part of a member group that has access. Could someone point me in the right direction for achieving this?
Hiding menu items in custom menu to which the user doesn't have access rights to
The following code is used to display a custom menu:
<xsl:for-each select="umbraco.library:GetXmlNodeById(@id)/node [string(data [@alias='showInTopMenu']) = '1']">
<li class="LevelTwo">
<a href="{umbraco.library:NiceUrl(@id)}" target="_top"><span><xsl:value-of select="string(data [@alias='pageTitle'])"/></span></a>
</li>
</xsl:for-each>
The problem with this approach is that this also shows pages that the user doesn't have access rights to. These pages shouldn't be displayed when the user is logged in and isn't part of the member group that has the access rights.
I can't find the documentation for adapting the above code so that it checks if the user is part of a member group that has access. Could someone point me in the right direction for achieving this?
Colin,
use IsLoggedOn() and HasAccess() xslt extension functions to find out if a member is logged on and has access to a specific page.
Cheers,
/Dirk
Thanks the HasAccess solved it for me (they see a different template with a different menu if they aren't logged in).
is working on a reply...