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
hi All. I am using Umbraco 4.5.1. My site structure is like below:
Content
-- Home
-- About Us
--- some sub pages
-- Contact Us
-- etc
And I used default nagivation xslt template for my site. like:
<xsl:variable name="level" select="1"/>
<xsl:for-each select="$currentPage/ancestor-or-self::* [@isDoc and @level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
However the navigation never shows if I add " [@isDoc and @level=$level]". Could anyone let me know how to fix it?
Thanks
Hi lingjing,
The expression in the for-each statement asks for children of the level 1 nodes, but based on your content, you actually want the level 1 nodes, so do like this:
<!-- Grab the content root --> <xsl:variable name="siteRoot" select="$currentPage/ancestor-or-self::root" /> <xsl:for-each select="$siteRoot/*[@isDoc][not(umbracoNaviHide = 1)]"> ... </xsl:for-each>
This way, you can just reassign the siteRoot variable if you add another level in the Content section.
/Chriztian
Thanks Chrizian
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Problem with top navigation
hi All. I am using Umbraco 4.5.1. My site structure is like below:
Content
-- Home
-- About Us
--- some sub pages
-- Contact Us
-- etc
And I used default nagivation xslt template for my site. like:
<xsl:variable name="level" select="1"/>
<xsl:for-each select="$currentPage/ancestor-or-self::* [@isDoc and @level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
However the navigation never shows if I add " [@isDoc and @level=$level]". Could anyone let me know how to fix it?
Thanks
Hi lingjing,
The expression in the for-each statement asks for children of the level 1 nodes, but based on your content, you actually want the level 1 nodes, so do like this:
<!-- Grab the content root --> <xsl:variable name="siteRoot" select="$currentPage/ancestor-or-self::root" /> <xsl:for-each select="$siteRoot/*[@isDoc][not(umbracoNaviHide = 1)]"> ... </xsl:for-each>
This way, you can just reassign the siteRoot variable if you add another level in the Content section.
/Chriztian
Thanks Chrizian
is working on a reply...