More in this section

Forums / Bugs & Issues / Sitemap Traversal Bug -- <urlMappings>

Sitemap Traversal Bug -- &lt;urlMappings&gt;

2 posts, 0 answered
  1. Isaac
    Isaac avatar
    63 posts
    01 Dec 2008
    19 Aug 2011
    Link to this post
    I'm attempting to build menus for subsites mapped in the <urlMappings> however code that works like a champion for the 'mainsite' do not work for any site listed in the <urlMappings>

    CmsSiteMapNode _cNode = (SiteMap.Provider.CurrentNode as CmsSiteMapNode);
    for (CmsSiteMapNode n = (_cNode.ChildNodes[0] as CmsSiteMapNode); n != null; n = (n.NextSibling as CmsSiteMapNode))
        if (n.Navigable)
            //Build Appropriate HTML for menu

    n.NextSibling always returns null no matter where I am in any of the subsite pages.
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    01 Feb 2016
    25 Aug 2011
    Link to this post
    Hi Isaac,

    The problem is that with urlMappings the current root node of the sitemap is changed when you go into a subdomain. For this you will have to get the parent node of the current node (if there is any) and then get its children.

    Kind regards,
    Radoslav Georgiev
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

2 posts, 0 answered