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

Forums / General Discussions / Sitemap ordering

Sitemap ordering

2 posts, 0 answered
  1. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    30 Jul 2008
    Link to this post
    Hi telerik,

    I've a question about the sitemap. Maybe it is a big secret, but I was wondering how it is possible to order the nodes inside a sitemap. I am writing my own custom sitemapprovider (that gets it's data from a database) and I'm wondering how I can sort the items?

    Since we can just drag pages inside sitefinity to change the order, it seems to me that it should be possible, somehow. That is, if your sitemap is based on the ASP.NET provider... maybe it's not?

    Well, a bit off-topic, but if someone knows, I really like to hear it.

    Thanks,
    Daniel
  2. Yasen
    Yasen avatar
    121 posts
    Registered:
    18 May 2013
    05 Aug 2008
    Link to this post
    Hi Daniel,

    The Telerik.Cms.Web.CmsSiteMapProvider works with the Cms Manager to create the site map. The following lines are from the BuildSiteMap method which is used with the default site map provider:

    public virtual SiteMapNode BuildSiteMap() 
      ... 
      IRootPage rootPage = cmsManager.GetRootPage(); 
      CmsRootSiteMapNode root = new CmsRootSiteMapNode(this, rootPage); 
      foreach (ICmsPage page in rootPage.Pages
        // continue creating the tree recursively 
      ... 
      return root; 

    The Pages property comes from the Telerik.Cms.IPagesContainer interface. It is implemented as ordered list in the Telerik.Cms.Data.CmsPage class. The database table sf_PageBase has a column called "Ordinal" which holds information about the order of pages which share the same parent.

    Hope this helps.

    All the best,
    Yasen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
2 posts, 0 answered