I have some issues with displaying some of the nodes in my site map. Actually i have some nodes which are hidden in my Navigation and so making use of the umbraco Property umbracoNaviHide, but I managed to make those links visible in my sitemap.
However I have some nodes in a folder in my content root which needs to be visible in the sitemap. Here is the piece of code am using with the following structure
If I understand you are only seeing one of the trees? Either Default or Folder 1?
The issue is probably that your starting xpath query is starting at the first level 1 ancestor, when you should start at the content root if you want all level 1 nodes. Try this instead:
<xsl:call-template name="drawNodes"> <xsl:with-param name="parent" select="$currentPage/ancestor::root/* [@isDoc and @level=1]"/> </xsl:call-template>
Yes am only seeing the nodes from Default while what i want is to be able to view bothe Default and Folder 1.
But i do have some other folder in my tree not only Default and Folder 1. My question is how to i get my sitemap to display all nodes under Default and Folder 1 and not to display the nodes from lets say Folder 2 - Folder 5.
Well, since all the nodes are on the same level I think you need a way to distinguish them from each other. Perhaps an umbracoNaviHide property or a new property "Hide in Sitemap"?
You could then do
<xsl:call-templatename="drawNodes"> <xsl:with-paramname="parent"select="$currentPage/ancestor::root/* [@isDoc and @level=1 and string(umbracoNaviHide) != '1']"/> </xsl:call-template>
Another option would be to start at the content root and only use the first two nodes (Default and Folder1) - assuming they'd always be in that order?
<xsl:call-templatename="drawNodes"> <xsl:with-paramname="parent"select="$currentPage/ancestor::root/* [@isDoc and @level=1][position() < 3]"/> </xsl:call-template>
I tried both "call-template" suggestions and they both crashed IIS. Not sure how but it did everytime.
My workaround was to use the custom property in a different way. I used it toexclude the Site Map itself from the listing on the Site Map page by creating a custom property called (as suggested) hideinSiteMap in the Site Map Document Type and adding a new criterion “and string(hideinSitemap) != '1' ” to the criteria in the XSL “for-each select” statement in the standard Site Map XSLT. I've no idea if this is the best way but the effect was to exclude the chosen page. I also did this for the root of a sub-section of the site and it and the child pages were excluded. So far I haven't discovered any negative effects.
SiteMap XSLT
Hi Guys,
I have some issues with displaying some of the nodes in my site map. Actually i have some nodes which are hidden in my Navigation and so making use of the umbraco Property umbracoNaviHide, but I managed to make those links visible in my sitemap.
However I have some nodes in a folder in my content root which needs to be visible in the sitemap. Here is the piece of code am using with the following structure
- Content
-- Default
--- Page 1
---- Sub Page 1
---- Sub Page 2
---- Sub Page 3
--- Page 2
---- Sub Page 1
---- Sub Page 2
--- Page 3
-- Folder 1
--- Page 1
---- Sub Page 1
---- Sub Page 2
---- Sub Page 3
At the moment i can see the nodes of Folder 1 in my sitemap. Can someone suggest something?
//fuji
Hi Fuji,
If I understand you are only seeing one of the trees? Either Default or Folder 1?
The issue is probably that your starting xpath query is starting at the first level 1 ancestor, when you should start at the content root if you want all level 1 nodes. Try this instead:
Hope this helps,
-Tom
Hi Tom,
Yes am only seeing the nodes from Default while what i want is to be able to view bothe Default and Folder 1.
But i do have some other folder in my tree not only Default and Folder 1. My question is how to i get my sitemap to display all nodes under Default and Folder 1 and not to display the nodes from lets say Folder 2 - Folder 5.
//Fuji
Well, since all the nodes are on the same level I think you need a way to distinguish them from each other. Perhaps an umbracoNaviHide property or a new property "Hide in Sitemap"?
You could then do
Another option would be to start at the content root and only use the first two nodes (Default and Folder1) - assuming they'd always be in that order?
-Tom
Actually i removed the umbracoNaviHide since i want to show the hidden links in the sitemap. But will try your suggesiton.
fuji
Tom it works, thanks mate.
//fuji
I tried both "call-template" suggestions and they both crashed IIS. Not sure how but it did everytime.
My workaround was to use the custom property in a different way. I used it to exclude the Site Map itself from the listing on the Site Map page by creating a custom property called (as suggested) hideinSiteMap in the Site Map Document Type and adding a new criterion “and string(hideinSitemap) != '1' ” to the criteria in the XSL “for-each select” statement in the standard Site Map XSLT. I've no idea if this is the best way but the effect was to exclude the chosen page. I also did this for the root of a sub-section of the site and it and the child pages were excluded. So far I haven't discovered any negative effects.
is working on a reply...