Is there a way to hide nodes for non authenticated users?
When a new user get in the web page he is able to see the nodes that are protected with "public access" options. He is not able to see the content until login, but I want those nodes to be unavailable. How can I do that?
Hide menu to non authenticated users
Hi,
Is there a way to hide nodes for non authenticated users?
When a new user get in the web page he is able to see the nodes that are protected with "public access" options. He is not able to see the content until login, but I want those nodes to be unavailable. How can I do that?
Thanks
Javier
BTW, I use RunwayDropdownNavigation.
Is it the xslt that I have to modify? Some one can point me how to do it?
Really thanks any help.
Javier,
use
in your xslt to check whether a user has rights to access a protected page.
Hope this helps.
Regards,
/Dirk
Hi Dirk.
Yep, that did it.
I'm really new to xslt, maybe you can help me with this:
How is the syntax of if condition in xslt,
I have:
<xsl:for-each select="$parent/node [string(./data [@alias='umbracoNaviHide']) != '1' and @level <= $maxLevel]">
if "node is protected" and umbraco.library:IsLoggedOn()=true then
......
end if
</xsl:for-each>
Thanks for your help.
javier
Here's a code snippet taken from the default Sitemap.xslt that comes with any umbraco installation:
Hi Dirk,
It does not work. I'll play more with it.
umbraco.library:IsProtected($currentPage/@id, $currentPage//@path) = 0
is that asking for the node that is in the previous for-each?
Ha, in that case, you should use replace $currentPage with .
I've made an extra small error as I was using // instead of /
Hope this helps.
Regards,
/Dirk
yeeeeaaaaaaa!!!! That made it. I need to learn xslt syntax :s.
Thanks :)
For the record of any one looking for same thing. the code that draws the nodes in the Runway Dropdown Menu is:
<xsl:template name="drawNodes">
<xsl:param name="parent"/>
<xsl:if test="umbraco.library:IsProtected($parent/@id, $parent/@path) = 0 or (umbraco.library:IsProtected($parent/@id, $parent/@path) = 1 and umbraco.library:IsLoggedOn() = 1)">
<xsl:for-each select="$parent/node [string(./data [@alias='umbracoNaviHide']) != '1' and @level <= $maxLevel]">
<xsl:if test="umbraco.library:IsProtected(./@id, ./@path) = 0 or (umbraco.library:IsProtected(./@id, ./@path) = 1 and umbraco.library:IsLoggedOn() = 1)">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/></a>
<xsl:if test="count(./node [string(./data [@alias='umbracoNaviHide']) != '1' and @level <= $maxLevel]) > 0">
<ul>
<xsl:call-template name="drawNodes">
<xsl:with-param name="parent" select="."/>
</xsl:call-template>
</ul>
</xsl:if>
</li>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:template>
wow... ir works perfectly.
thanks for sharing
is working on a reply...