I've got a fairly simple menu that I've used for a while and today I've created another item/page for the menu. I want this item to appear in the middle of the menu so after I'd created the page I used the standard sort functionality in Umbraco to put the page where I want it to appear but new page is appearing at the end of the menu instead of in the middle....
Here's my XLST
<!-- For each child node of the homeNode that is a document (isDoc) and the level is 1 and the property umbracoNaviHide is NOT 1 (true/checked) --> <xsl:for-each select="$homeNode/* [@isDoc and @level = 2 and string(umbracoNaviHide) != '1' and string(topLevelNavigationItem) = '1' ]"> <li> <!-- Add the CSS class 'selected' if the currentPage or parent nodes (up the tree to the root) ID matches our current node's ID in the for each loop --> <xsl:if test="$currentPage/ancestor-or-self::* [@isDoc]/@id = current()/@id"> <xsl:attribute name="class"> <xsl:text>active</xsl:text> </xsl:attribute> </xsl:if>
This could just be an old publishing bug (don't remember the version, but I had this hit me once in a while on some older sites) - something to do with the XML cache not being totally rebuilt (i.e. reordered correctly) right away.
Because the XML for the items are updated, there's a way to fix it though, using the sort instruction, sorting on the sortOrder attribute:
XSLT Menu displaying out of content order
Hi all,
I've got a fairly simple menu that I've used for a while and today I've created another item/page for the menu. I want this item to appear in the middle of the menu so after I'd created the page I used the standard sort functionality in Umbraco to put the page where I want it to appear but new page is appearing at the end of the menu instead of in the middle....
Here's my XLST
And here's a screenshot of the content structure:
But when the menu displays 'In-house' comes after Blog.
Any ideas anyone?
Hi Craig
Have you tried to simply refresh the XML cache by right clicking the "CONTENT" node and choose "Republish" entire site? I it might just be that.
/Jan
Hi Craig,
This could just be an old publishing bug (don't remember the version, but I had this hit me once in a while on some older sites) - something to do with the XML cache not being totally rebuilt (i.e. reordered correctly) right away.
Because the XML for the items are updated, there's a way to fix it though, using the sort instruction, sorting on the
sortOrder
attribute:/Chriztian
That worked a treat!
is working on a reply...