I recently upgraded an old umbraco install from an early version of 4 to the latest 4.11. I had to convert the xslt to the new format and as part of that upgrade, something has gone a bit pear shaped.
The XSLT runs through the site structure looking for nodes with a tick in the showinnav at the level it is currently at in the structure. When you click on a page in the menu, it looks at that level and checks whether or not it should add in an extra layer or not.
It currently works fine for the top level, just doesn't display any levels below that if I click on an item that has child nodes.
Didn't make any difference at all. Looking at the code, that hadn't changed so I think I may have been pointing you in the wrong direction. Could it be the syntax of the for-each?
XSLT upgrade went a bit wrong
Hi everyone,
I recently upgraded an old umbraco install from an early version of 4 to the latest 4.11. I had to convert the xslt to the new format and as part of that upgrade, something has gone a bit pear shaped.
The XSLT runs through the site structure looking for nodes with a tick in the showinnav at the level it is currently at in the structure. When you click on a page in the menu, it looks at that level and checks whether or not it should add in an extra layer or not.
It currently works fine for the top level, just doesn't display any levels below that if I click on an item that has child nodes.
My old xslt:
My new xslt:
I have isolated the issue to the if tests that is run (highlighted in the code). I think the syntax is slightly out there.
If anyone could help, it'd be much appreciated as I've made the site live now and it's getting harder to revert back by the hour!!
Thanks,
Tom
Hi Tom,
I think if you change this line
<xsl:if test="$currentPage/ancestor-or-self::node/@id = current()/@id">
To simply this then you should be good.
<xsl:if test="$currentPage/ancestor-or-self/@id = current()/@id">
Hope this helps,
/Dennis
Thanks for the quick response Dennis.
Didn't make any difference at all. Looking at the code, that hadn't changed so I think I may have been pointing you in the wrong direction. Could it be the syntax of the for-each?
I'm not really sure though..
Got it!
Should have been:
Thanks a lot for the help Dennis
Panic over. :D
Hi Tom,
If you see the prototype navigation XSLT this is how they are doing it where the umbracoNaviHide is a built in function to decide if the page should be visible in the navigation http://our.umbraco.org/wiki/reference/umbraco-best-practices/umbraconavihide
And if it checked then the navigation whould not show in the navigation but you just changed this.
Hope this helps,
/Dennis
is working on a reply...