Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have one question about the xslt and the navigation menu.
If i have a structure like this:
- Home
- About us
- Our projects
- Login
And i have this code:
<?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:param name="currentPage"/><xsl:template match="/"><!-- start writing XSLT --><ul id="nav"><xsl:for-each select="$currentPage/ancestor::root/node [string(./data [@alias='umbracoNaviHide']) != '1']"> <li> <xsl:if test="$currentPage/@id=current()/@id"> <xsl:attribute name="class">Selected</xsl:attribute> </xsl:if> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:attribute name="title"><xsl:value-of select="@nodeName" /></xsl:attribute> <xsl:value-of select="@nodeName" /> </a> </li></xsl:for-each><xsl:for-each select="$currentPage/ancestor-or-self::node [@level=1]/node [string(./data [@alias='umbracoNaviHide']) != '2']"> <li> <xsl:if test="$currentPage/ancestor-or-self::node/@id = current()/@id"> <xsl:attribute name="class">Selected</xsl:attribute> </xsl:if> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:attribute name="title"><xsl:value-of select="@nodeName" /></xsl:attribute> <xsl:value-of select="@nodeName" /> </a> </li></xsl:for-each></ul></xsl:template></xsl:stylesheet>
Of course the navigation looks like this:
Home Login About us Our projects
But how can i have just navigation for "Home", so without the "Login".
Tnx
Hi, use the property umbracoNaviHide. Add it to your document type, and then check it for the login page.
Regards
Jonas
Also @alias='umbracoNaviHide']) != '2' is not correct, the umbracoNaviHide should be a true/false property and the correct use would be @alias='umbracoNaviHide']) != '1'
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Navigation
I have one question about the xslt and the navigation menu.
If i have a structure like this:
- Home
- About us
- Our projects
- Login
And i have this code:
<?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:param name="currentPage"/>
<xsl:template match="/">
<!-- start writing XSLT -->
<ul id="nav">
<xsl:for-each select="$currentPage/ancestor::root/node [string(./data [@alias='umbracoNaviHide']) != '1']">
<li>
<xsl:if test="$currentPage/@id=current()/@id">
<xsl:attribute name="class">Selected</xsl:attribute>
</xsl:if>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:attribute name="title"><xsl:value-of select="@nodeName" /></xsl:attribute>
<xsl:value-of select="@nodeName" />
</a>
</li>
</xsl:for-each>
<xsl:for-each select="$currentPage/ancestor-or-self::node [@level=1]/node [string(./data [@alias='umbracoNaviHide']) != '2']">
<li>
<xsl:if test="$currentPage/ancestor-or-self::node/@id = current()/@id">
<xsl:attribute name="class">Selected</xsl:attribute>
</xsl:if>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:attribute name="title"><xsl:value-of select="@nodeName" /></xsl:attribute>
<xsl:value-of select="@nodeName" />
</a>
</li>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>
Of course the navigation looks like this:
Home Login About us Our projects
But how can i have just navigation for "Home", so without the "Login".
Tnx
Hi, use the property umbracoNaviHide. Add it to your document type, and then check it for the login page.
Regards
Jonas
Also @alias='umbracoNaviHide']) != '2' is not correct, the umbracoNaviHide should be a true/false property and the correct use would be @alias='umbracoNaviHide']) != '1'
is working on a reply...