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 installed the (razor) package in v6 but got no pages in the sitemap (just the empty <urlset> tag.
There seems to be some problem (bug?) with the Linq parsing of the Where clause for umbracoNaviHide.
To get it working, I done this:
Before:
foreach (var node in startNode.Children .Where("HasAccess") .Where("!IsProtected") .Where("umbracoNaviHide == false") ) { if(node.template > 0) { <url>
After:
foreach (var node in startNode.Children .Where("HasAccess") .Where("!IsProtected") ) { if(node.template > 0 && !node.umbracoNaviHide) { <url>
I also had to add the () to the Count method as described by Dan in this thread.
if (node.Level <= maxLevelForSiteMap && node.ChildrenAsList.Count() > 0)
Hope this helps!
-tk
This worked for me too! Thanks!
I tried just adding the () th the Count method also, but that did not sort the issue. It was not until I made the changes you suggested that things started working. I will raise a glass to you this evening and drink to your health!
(running 4.11.1, not v6 though)
Josh
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
V6 beta problem - no pages (with fix)
I installed the (razor) package in v6 but got no pages in the sitemap (just the empty <urlset> tag.
There seems to be some problem (bug?) with the Linq parsing of the Where clause for umbracoNaviHide.
To get it working, I done this:
Before:
After:
I also had to add the () to the Count method as described by Dan in this thread.
Hope this helps!
-tk
This worked for me too! Thanks!
I tried just adding the () th the Count method also, but that did not sort the issue. It was not until I made the changes you suggested that things started working. I will raise a glass to you this evening and drink to your health!
(running 4.11.1, not v6 though)
Josh
is working on a reply...