Copied to clipboard

Flag this post as spam?

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


  • Richard Terris 273 posts 715 karma points
    Oct 10, 2013 @ 14:48
    Richard Terris
    0

    Search Engine Sitemap Problems in V6.1.6

    Hi guys,

    I'm having an issue with this package on a 6.1.6 site.

    I have checked the settings against a 4.9.1 site and it's set up in exactly the same way.

    So the issue, according the log.txt file is 'umbraco.MacroEngines.DynamicNodeList' does not contain a definition for 'Count' on CultivSearchEngineSitemap.cshtml:line 30

    the offending line is: 

    if (node.Level <= maxLevelForSiteMap && node.ChildrenAsList.Count > 0)
            {
                @ListChildNodes(node)

            }

     

    If I change this to node.Descendants.Count it works - WORKS in that it doesn't break but the only node that's actually appearing in the sitemap is the sitemap

    This is the same if I remove this second check, or if I remove the if statement altogether which I tried for the sake of testing

    Anyone had this issue?

     

    Thanks

  • Richard Terris 273 posts 715 karma points
    Oct 10, 2013 @ 14:50
    Richard Terris
    0

    Incidentally - once in "code mode", how do you break out back into normal paragraph mode?!

  • wolulcmit 357 posts 693 karma points
    Oct 14, 2013 @ 02:41
    wolulcmit
    0

    I Had this problem too and removed the Count check to solve the problem. Incidentally I ended up going back to the xslt version of Cultiv's code as my site was quite large it took about 40 seconds to render the Razor version as opposed to 2 seconds the xslt version takes. Not sure if this is just the fact that this was written pre v6 and I'm using v6.1.3 (similar to you)

    - Tim

  • Richard Terris 273 posts 715 karma points
    Oct 14, 2013 @ 12:00
    Richard Terris
    100

    I don't think removing the check is an ideal solution but changing the check to node.DescendantsOrSelf.Count seems to work

  • Bjarne Fyrstenborg 1282 posts 3994 karma points MVP 8x c-trib
    Oct 20, 2013 @ 17:12
    Bjarne Fyrstenborg
    0

    I tried with node.DescendantsOrSelf.Count, but I only get the first levels below my startnode then..

    I have used node.ChildrenAsList.Items.Count > 0 instead, so I get the nodes on lower levels too..

    /Bjarne

  • ID 27 posts 128 karma points
    Nov 12, 2013 @ 16:08
    ID
    0

    Same problem here. Changing to node.ChildrenAsList.Count() works as well.

Please Sign in or register to post replies

Write your reply to:

Draft