Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Trond K. 11 posts 52 karma points
    Jan 17, 2013 @ 14:43
    Trond K.
    0

    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:

     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

     

     

     

     

     

     

     

     

  • Josh Olson 79 posts 207 karma points
    Feb 06, 2013 @ 15:14
    Josh Olson
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft