+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / ICmsUrlContext.GetSiteMapNode returns only nodes that Navigable

ICmsUrlContext.GetSiteMapNode returns only nodes that Navigable

3 posts, 1 answered
  1. Connections Academy Developer
    Connections Academy Developer avatar
    151 posts
    Registered:
    04 May 2005
    01 Aug 2013
    Link to this post
    I'm using SF 3.7.

    I have a method that returns the CmsSiteMapNode of the given url, but when traversing the children of this node only nodes marked as Navigable are returned in the collection of children. How can I pull all children, Navigable and non-Navigable, of a CmsSiteMapNode?

    ICmsUrlContext context = UrlHelper.GetUrl(UrlPath.ResolveUrl(url), true);
    var node = context.GetSiteMapNode() as CmsSiteMapNode;
    var childrenNodes = node.ChildNodes;
  2. Connections Academy Developer
    Connections Academy Developer avatar
    151 posts
    Registered:
    04 May 2005
    07 Aug 2013 in reply to Connections Academy Developer
    Link to this post
    bump
  3. Connections Academy Developer
    Connections Academy Developer avatar
    151 posts
    Registered:
    04 May 2005
    07 Aug 2013
    Link to this post
    I figured it out. When trying to get the children from a CmsSiteMapNode I call GetChildNodes from the provider of the CmsSiteMapNode, passing SiteMapDisplayMode.All as the second argument.

    var provider = (CmsSiteMapProvider)cmsNode.Provider;
    foreach(CmsSiteMapNode child in provider.GetChildNodes(cmsNode, SiteMapDisplayMode.All)) {
        ....
    }
    Answered
3 posts, 1 answered